Skip to content

πŸ›‘οΈ Sentinel: [HIGH] Fix Path Traversal (Zip Slip) in Skill Imports#172

Open
thirdeyenation wants to merge 1 commit into
mainfrom
sentinel-fix-zip-slip-5553890262309735703
Open

πŸ›‘οΈ Sentinel: [HIGH] Fix Path Traversal (Zip Slip) in Skill Imports#172
thirdeyenation wants to merge 1 commit into
mainfrom
sentinel-fix-zip-slip-5553890262309735703

Conversation

@thirdeyenation

Copy link
Copy Markdown
Owner

🚨 Severity: HIGH
πŸ’‘ Vulnerability: Path Traversal (Zip Slip) vulnerability in helpers/skills_import.py where uploaded ZIP files were extracted using zipfile.extractall() without verifying if the individual file paths safely remain within the intended destination directory.
🎯 Impact: A maliciously crafted archive could bypass path containment, allowing an attacker to write files anywhere on the filesystem that the application process has permissions to access (e.g. overwriting configurations or dropping executable code).
πŸ”§ Fix: Iterated through z.namelist() and resolved each member's extraction path. Added a strict check using Path.is_relative_to() to ensure every resolved path remains inside the target extraction folder. If any unsafe path is detected, it raises a ValueError to block the extraction entirely.
βœ… Verification: Run the standard test suite to ensure standard skills still import correctly, and check the code to see that z.namelist() is inspected before extraction.


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

Added validation of archive members in `_unzip_to_temp_dir`
using `Path.is_relative_to()` before calling `extractall()`.

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