Security context

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

thoughtbot/paperclip
main @ c769382
5
Fixes
2
CVEs
CRITICAL
Peak severity
20.0%
Coverage
Highlights
Auth Bypass: 1 prior fix. Scrutinize any change in this area.
Paperclip::MediaTypeSpoofDetector: most-fixed (1 issue). Treat as high-risk during review.
1 high-severity fix in this history; regressions here are high-impact.
Recurring patterns

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

SSRF: Attackers can exploit automatic URI resolution adapters to perform Server-Side Request Forgery and scan internal server infrastructure. Disabling default automatic URI/HTTP adapters is critical to enforce explicit boundaries on file-retrieval sources.
Bypass of File Validation: Files uploaded without extensions bypass media type spoof validations, allowing potentially dangerous active content (such as spoofed HTML/XSS files) to skip verification entirely. Safe fallbacks must run regardless of file extension presence.
Validation Bypass: Using the \Z anchor in regular expressions allows attackers to append trailing newlines to filenames or content-types, bypassing match constraints. Replacing this with \z prevents attackers from sneaking disallowed payloads or extensions past validators.