Commit ff1d380
Fix: form-action CSP blocked atproto login form submission (v0.4.2) (#107)
* Fix: drop form-action CSP that blocked the atproto handle form submit
The handle-entry form sets a strict CSP. The `form-action 'self'` directive
(added for defense-in-depth) silently broke login: submitting the form hits
our endpoint, which immediately 302-redirects to the user's own
authorization server (any PDS, cross-origin). `form-action` is enforced
across the entire redirect chain, so `'self'` blocks the submission and the
browser does nothing — exactly the "form doesn't send me there" symptom,
while navigating to the auth URL directly worked (no form-action involved).
Remove the `form-action` directive entirely — it is fundamentally
incompatible with a login form that must redirect to per-user auth servers.
The rest of the hardening (default-src 'none', no scripts, frame-ancestors,
nosniff, no-store, style-src 'self') stays. Add a regression test asserting
the form CSP never carries form-action.
Reproduced and verified the fix by driving the form in headless Chrome.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Release v0.4.2
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 41fcfb8 commit ff1d380
4 files changed
Lines changed: 12 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
311 | 313 | | |
312 | 314 | | |
313 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| |||
0 commit comments