Security context

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

spatie/image-optimizer
main @ 9e1db47
5
Fixes
0
CVEs
HIGH
Peak severity
75.0%
Coverage
Highlights
Auth Bypass: 1 prior fix. Scrutinize any change in this area.
src/OptimizerChain.php: most-fixed (3 issues). Treat as high-risk during review.
5 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.

Deserialization of Untrusted Data: Using PHP stream wrappers with unchecked schemes on file existence checks (like file_exists) can trigger Phar deserialization attacks. This was fixed by enforcing a strict 'file' protocol scheme allowlist.
Phar Deserialization: Processing image paths before validation or copying them before verifying their structures exposes the application to remote code execution via Phar deserialization. The ordering of instantiation and system operations (like copy) is highly sensitive.
Path Traversal: Misrouting variable assignments during optimization runs can result in the original source path being targeted rather than the designated temporary output path, bypassing isolation boundaries.