Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix path traversal in file_info and download_work_dir_file#19

Open
thirdeyenation wants to merge 1 commit intomainfrom
sentinel-path-traversal-fix-96874249595781153
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix path traversal in file_info and download_work_dir_file#19
thirdeyenation wants to merge 1 commit intomainfrom
sentinel-path-traversal-fix-96874249595781153

Conversation

@thirdeyenation
Copy link
Copy Markdown
Owner

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: The get_abs_path function returns the absolute path untouched if the input is already absolute. This allowed path traversal to read arbitrary files via api/file_info.py and api/download_work_dir_file.py (e.g. providing /etc/passwd).
🎯 Impact: Attackers could read arbitrary sensitive files on the system or server.
πŸ”§ Fix: Implemented files.is_in_base_dir(abs_path) boundary checks in api/file_info.py, api/download_work_dir_file.py, and helpers/file_browser.py to prevent access to files outside of the configured base directory.
βœ… Verification: Tested against standard inputs and absolute paths. The path traversal attempt now logs a warning and raises an Exception or returns exists: False, resolving the vulnerability. Run pytest tests/ to confirm.


PR created automatically by Jules for task 96874249595781153 started by @thirdeyenation

…work_dir_file

Co-authored-by: thirdeyenation <133812267+thirdeyenation@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

πŸ‘‹ 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant