Commit 7abfcd4
fix: use constant-time comparison for auth token (CWE-208)
Replace direct === comparison with crypto.timingSafeEqual via SHA-256
digest to prevent timing-based token extraction attacks.
- No behavioral change for valid authentication flows
- Uses stdlib only (crypto) — no new dependencies
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent ee821b0 commit 7abfcd4
1 file changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
6 | 17 | | |
7 | 18 | | |
8 | 19 | | |
| |||
19 | 30 | | |
20 | 31 | | |
21 | 32 | | |
22 | | - | |
| 33 | + | |
23 | 34 | | |
24 | 35 | | |
25 | 36 | | |
| |||
0 commit comments