π‘οΈ Sentinel: [CRITICAL] Fix Path Traversal via Symbolic Links#819
π‘οΈ Sentinel: [CRITICAL] Fix Path Traversal via Symbolic Links#819
Conversation
Co-authored-by: georgi <19498+georgi@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Co-authored-by: georgi <19498+georgi@users.noreply.github.com>
Co-authored-by: georgi <19498+georgi@users.noreply.github.com>
This PR fixes a security vulnerability in
src/nodetool/io/path_utils.pywhereos.path.abspathwas being used to evaluate whether a requested file path was within the designatedworkspace_dir.π¨ Severity: CRITICAL
π‘ Vulnerability: Symlink-based Path Traversal
π― Impact: If a malicious user or external process were able to create a symbolic link within their workspace that points to a directory outside of the workspace (e.g.,
/or/etc),os.path.abspathwould not resolve the symlink. This allowed requests traversing the symlink to pass thecommonpathboundary check, granting arbitrary read/write access to the host filesystem.π§ Fix: Replaced
os.path.abspathwithos.path.realpathfor both the workspace root and the target path.os.path.realpathfully resolves all symbolic links before evaluating the boundaries, correctly denying access to outside files.β Verification: A test case
test_resolve_workspace_path_with_symlink_traversal_attackwas added totests/common/test_path_utils.pyto ensure traversing an outside symlink correctly throws aValueError. The fix has been verified and passes tests.PR created automatically by Jules for task 12244774363765268999 started by @georgi