Commit 8019edf
authored
Remove usage of subtle.ConstantTimeCompare in validation (#8519)
While constant-time comparison is important in cryptographic algorithms,
that's not what we're doing here. The validation random token is not
intended to be secret in the same way as (say) a private key is: it's
just meant to be random enough that it's unlikely to exist in DNS or on
a webserver by chance. Possession of the random token does not give an
attacker any advantages; they still need to control the domain itself,
at which point they could get a random token of their own. Using
subtle.ConstantTimeCompare is overkill and sets a bad example for places
that truly do need to use it.1 parent a8b4a43 commit 8019edf
2 files changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
125 | | - | |
| 124 | + | |
126 | 125 | | |
127 | 126 | | |
128 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
367 | 366 | | |
368 | 367 | | |
369 | 368 | | |
370 | | - | |
| 369 | + | |
371 | 370 | | |
372 | 371 | | |
373 | 372 | | |
| |||
0 commit comments