Skip to content

Harden package archive extraction - #1

Merged
CAOShurong merged 1 commit into
mainfrom
agent/archive-boundary-hardening
Aug 9, 2026
Merged

CAOShurong merged 1 commit into
mainfrom
agent/archive-boundary-hardening

Conversation

@CAOShurong

Copy link
Copy Markdown
Owner

Outcome

Prevent downloaded package archives from writing outside willitbreak's cache destination, and prepare the patched 0.1.1 release.

Security change

  • replace the string-prefix boundary check with exact path-component containment
  • extract ZIP and tar members as regular files/directories instead of delegating to extractall
  • reject links, devices, FIFOs, and other unsupported tar members
  • add regression cases for same-prefix sibling traversal and special tar entries

Verification

  • 92 unit tests pass, including the controlled archive traversal reproducer
  • Ruff lint and format checks pass
  • generated README check passes
  • wheel and sdist build successfully and pass strict Twine validation
  • the wheel installs cleanly in a fresh environment
  • live checks retain exit code 2 for a real breaking urllib3 upgrade and 0 for a compatible requests upgrade

Release

Version is bumped to 0.1.1. After merge, the existing tag-triggered release workflow can publish the patched artifacts.

@CAOShurong
CAOShurong marked this pull request as ready for review August 9, 2026 02:41
@CAOShurong
CAOShurong merged commit 1d541f4 into main Aug 9, 2026
12 checks passed
@CAOShurong
CAOShurong deleted the agent/archive-boundary-hardening branch August 9, 2026 02:41
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