fix: prevent Zip Slip path traversal in ZIP extraction#879
Merged
qin-ctx merged 1 commit intovolcengine:mainfrom Mar 23, 2026
Merged
fix: prevent Zip Slip path traversal in ZIP extraction#879qin-ctx merged 1 commit intovolcengine:mainfrom
qin-ctx merged 1 commit intovolcengine:mainfrom
Conversation
Replace extractall() with safe_extract_zip() that validates each member's resolved path stays within the target directory. Applied to both skill_processor.py and media_processor.py. Fixes volcengine#878 Fixes volcengine#866
|
|
|
Failed to generate code suggestions for PR |
qin-ctx
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces unsafe
zipf.extractall()calls with a validated extraction helpersafe_extract_zip()that checks each archive member's resolved path stays within the target directory before writing.Changes
openviking/utils/zip_safe.py— sharedsafe_extract_zip()helper that validates per-member pathsopenviking/utils/skill_processor.py— replacedextractall()withsafe_extract_zip()openviking/utils/media_processor.py— replacedextractall()withsafe_extract_zip()Security
This prevents Zip Slip (path traversal) attacks where a malicious ZIP archive contains entries with
../or absolute paths to write files outside the intended extraction directory.Fixes #878
Fixes #866