Skip to content

fix: prevent Zip Slip path traversal in ZIP extraction#879

Merged
qin-ctx merged 1 commit intovolcengine:mainfrom
r266-tech:fix/zip-slip-path-traversal
Mar 23, 2026
Merged

fix: prevent Zip Slip path traversal in ZIP extraction#879
qin-ctx merged 1 commit intovolcengine:mainfrom
r266-tech:fix/zip-slip-path-traversal

Conversation

@r266-tech
Copy link
Contributor

Summary

Replaces unsafe zipf.extractall() calls with a validated extraction helper safe_extract_zip() that checks each archive member's resolved path stays within the target directory before writing.

Changes

  • New file: openviking/utils/zip_safe.py — shared safe_extract_zip() helper that validates per-member paths
  • Modified: openviking/utils/skill_processor.py — replaced extractall() with safe_extract_zip()
  • Modified: openviking/utils/media_processor.py — replaced extractall() with safe_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

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
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
Copy link

Failed to generate code suggestions for PR

@qin-ctx qin-ctx merged commit ab77335 into volcengine:main Mar 23, 2026
4 of 6 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

4 participants