Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix Path Traversal (Zip Slip) in Skills Import#132

Open
thirdeyenation wants to merge 1 commit into
mainfrom
sentinel/fix-zip-slip-skills-import-8597553096293329101
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix Path Traversal (Zip Slip) in Skills Import#132
thirdeyenation wants to merge 1 commit into
mainfrom
sentinel/fix-zip-slip-skills-import-8597553096293329101

Conversation

@thirdeyenation
Copy link
Copy Markdown
Owner

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: Zip Slip (Path Traversal) in helpers/skills_import.py where zipfile.ZipFile.extractall() is called without validating archive members. This allows a maliciously crafted ZIP file to overwrite sensitive files outside the intended target directory.
🎯 Impact: Remote code execution (RCE) or sensitive data overwrite. When a user or agent imports an external skill from a malicious ZIP file, files outside the tmp/skill_imports/ directory could be overwritten (e.g., placing arbitrary executables or overwriting .bashrc or configuration files).
πŸ”§ Fix: Manually validate each member of the ZIP archive (z.namelist()) by securely resolving its target destination using Path.resolve() and ensuring it remains within the intended extraction directory using Path.is_relative_to(). If an unsafe path is detected, it raises a ValueError to fail securely.
βœ… Verification: Ran pytest tests/test_skills_runtime.py to ensure skill parsing/imports still function correctly, and verified that any attempt to extract an archive with path traversal characters throws an exception.


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

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