Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

laminas/laminas-filter
3.5.x @ 45e53ad
3
Fixes
0
CVEs
HIGH
Peak severity
0.0%
Coverage
Highlights
Arbitrary File Write: 2 prior fixes. Scrutinize any change in this area.
src/Compress/Zip.php: most-fixed (1 issue). Treat as high-risk during review.
3 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Arbitrary File Write: The original filter allowed moving arbitrary files via rename(), enabling an attacker to write to any writable location by supplying a crafted source path. The fix removed the fallback and now requires is_uploaded_file().
Arbitrary File Write: A generic rename-based upload filter could move non-uploaded files, leading to arbitrary file write. The fix introduced a dedicated filter using move_uploaded_file(), which only operates on actual uploads.
Path Traversal: ZIP extraction used extractTo() without validating entry names, allowing malicious archives to write outside the target directory via upward traversal. The fix adds target directory validation and traversal detection.