Commit e0b0cf9
committed
fix(security): Timing Attack Vulnerability
A timing attack vulnerability exists in the SCRAM Java implementation.
The issue arises because Arrays.equals was used to compare secret values
such as client proofs and server signatures. Since Arrays.equals
performs a short-circuit comparison, the execution time varies depending
on how many leading bytes match. This behavior could allow an attacker
to perform a timing side-channel attack and potentially infer sensitive
authentication material. All users relying on SCRAM authentication are
impacted.
This vulnerability has been patched by replacing Arrays.equals with
MessageDigest.isEqual, which ensures constant-time comparison.1 parent fa443aa commit e0b0cf9
3 files changed
Lines changed: 9 additions & 4 deletions
File tree
- checks
- scram-common/src/main/java/com/ongres/scram/common
- scram-parent
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | | - | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
| 193 | + | |
195 | 194 | | |
196 | 195 | | |
197 | 196 | | |
| |||
205 | 204 | | |
206 | 205 | | |
207 | 206 | | |
208 | | - | |
| 207 | + | |
| 208 | + | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
533 | 536 | | |
534 | 537 | | |
535 | 538 | | |
| |||
0 commit comments