You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ConstantTimeCompare function in crypto/subtle/constant_time.go will return in O(1) if the lengths of both function parameters are not equal, and O(n) if the lengths are equal.
Security concern:
bcrypt's CompareHashAndPassword function uses subtle's constant time compare to combat timing attacks. One could discover the length of a password hash which could be an attack vector when paired with another exploit.
Risk level is low, but any unanticipated leak of data is still a leak and this should be addressed.
Potential solution:
If lengths of x and y are not the same, proceed to compare as normal but in this case, always return 0. I'm open to suggestions.
The text was updated successfully, but these errors were encountered:
Type: Potential Exploit
Go v1.17 (Latest)
Problem:
go/src/crypto/subtle/constant_time.go
Lines 13 to 15 in 4711bf3
The
ConstantTimeCompare
function in crypto/subtle/constant_time.go will return in O(1) if the lengths of both function parameters are not equal, and O(n) if the lengths are equal.Security concern:
bcrypt's
CompareHashAndPassword
function uses subtle's constant time compare to combat timing attacks. One could discover the length of a password hash which could be an attack vector when paired with another exploit.Risk level is low, but any unanticipated leak of data is still a leak and this should be addressed.
Potential solution:
If lengths of
x
andy
are not the same, proceed to compare as normal but in this case, always return0
. I'm open to suggestions.The text was updated successfully, but these errors were encountered: