Skip to content

Commit a6489b1

Browse files
committed
#62732 Fix password validation in PasswordHasher`1: add check for upper bound for salt size before allocation an array
1 parent 1b5d54e commit a6489b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Identity/Extensions.Core/src/PasswordHasher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ private static bool VerifyHashedPasswordV3(byte[] hashedPassword, string passwor
260260
int saltLength = (int)ReadNetworkByteOrder(hashedPassword, 9);
261261

262262
// Read the salt: must be >= 128 bits
263-
if (saltLength < 128 / 8)
263+
if (saltLength < 128 / 8 || saltLength + 13 > hashedPassword.Length)
264264
{
265265
return false;
266266
}

0 commit comments

Comments
 (0)