Repository navigation
Commit c4269e2
fix(lib-auth): reject OAuth callbacks when no login was started
validateNonce compared the callback's state nonce with the one stored
in sessionStorage without checking that one was stored. With no login
in progress the stored side is null, so a crafted callback carrying
state={"nonce":null} passed the check and signed the victim in with
the attacker's token (login CSRF) on the implicit flow.
Only accept a non-empty string nonce that matches the stored one.
Fixes GHSA-h6vp-4qr8-gvh5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 1a1d148 commit c4269e2
2 files changed
Lines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
16 | 37 | | |
17 | 38 | | |
18 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
0 commit comments