0
Security-focused code review against a specific threat model
Review this code for security issues, but scope it to the threat model I give you, don't produce a generic OWASP checklist dump. Threat model: {{threat_model, e.g. 'attacker controls request body and headers but has no valid auth token'}}.
For each finding:
1. State the exact attacker action that would trigger it, concretely, as if writing a proof-of-concept step.
2. State what the code currently assumes that isn't actually guaranteed (e.g. 'assumes Content-Type header matches actual body format').
3. Severity based on real exploitability given the threat model, not textbook severity (a SQL injection with no path for attacker-controlled input to the query isn't a blocker here).
4. Fix, minimal and specific to the code, not a rewrite.
5. Explicitly list what you checked and found NOT to be an issue given the threat model (e.g. 'CSRF not applicable, this is a server-to-server API with mTLS'), so I know the review was thorough rather than just silent on those.
Code: code
Auth/deployment context: context