Highlights
Auth Bypass: 1 prior fix. Scrutinize any change in this area.
corsheaders/middleware.py: most-fixed (2 issues). 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.
Auth Bypass: Insecure or overly permissive hostname validation can allow unauthorized third-party origins to bypass CORS policies. Utilizing robust regular expressions to enforce host allowlists prevents attackers from exploiting wildcard matching weaknesses to access sensitive endpoints.
CORS Misconfiguration: Dynamically setting the Access-Control-Allow-Origin header without modifying the Vary header can lead to caching proxies serving CORS-approved responses to unauthorized origins. Developers must ensure the Vary header always includes 'Origin' when CORS headers are determined dynamically.