Case Study: Archive Path Traversal Near Miss
How an archive extraction path bug was discovered during QA and neutralized before wider impact.
archive
security
Signal
A QA run detected extracted file paths escaping the expected temp directory during archive unpacking.
Root Cause
Path normalization occurred after write-path concatenation, allowing crafted entries with traversal segments to bypass intended directory constraints.
Fix
- Normalize and validate archive entry paths before any file write.
- Reject absolute paths and traversal tokens.
- Enforce expanded-size and file-count limits.
Regression Guard
Added malicious archive fixtures to security tests and required extraction policy checks in CI for archive-related changes.