π‘οΈ Sentinel: [HIGH] Fix Path Traversal (Zip Slip) in Skill Imports#172
π‘οΈ Sentinel: [HIGH] Fix Path Traversal (Zip Slip) in Skill Imports#172thirdeyenation wants to merge 1 commit into
Conversation
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>
|
π 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. |
π¨ Severity: HIGH
π‘ Vulnerability: Path Traversal (Zip Slip) vulnerability in
helpers/skills_import.pywhere uploaded ZIP files were extracted usingzipfile.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 usingPath.is_relative_to()to ensure every resolved path remains inside thetargetextraction folder. If any unsafe path is detected, it raises aValueErrorto 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