Repository navigation
Commit 5a9c9b4
fix(security): restrict CORS and add security response headers [REN-74]
Replace wildcard CORS allow_methods/allow_headers with explicit lists
to reduce attack surface (OWASP A05). Add SecurityHeadersMiddleware
with X-Content-Type-Options, X-Frame-Options, X-XSS-Protection,
Referrer-Policy, and Permissions-Policy on all responses. HSTS is
enabled only in production.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent ce11c90 commit 5a9c9b4
2 files changed
Lines changed: 29 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
71 | 92 | | |
72 | 93 | | |
73 | 94 | | |
| |||
90 | 111 | | |
91 | 112 | | |
92 | 113 | | |
93 | | - | |
94 | | - | |
| 114 | + | |
| 115 | + | |
95 | 116 | | |
96 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
97 | 121 | | |
98 | 122 | | |
99 | 123 | | |
| |||
0 commit comments