My security team escalated to me that the PasswordHasher is vulnerable to heap inspection, as the password is of type String.
It should be instead a byte array / span of bytes cleared at the end of the process, as it is done by any cryptographic operation in corefx. CC @bartonjs.
Same problem with any password related types (IPasswordValidator, and maybe also the IUserPasswordStore)
The text was updated successfully, but these errors were encountered:
ycrumeyrolle
changed the title
Passwords should not be of type String
[Question] Passwords should not be of type String ?
Nov 1, 2018
When the passwords are delivered over an HTTP request they're strings. You can pretend to add safety by turning them into a byte array, but it doesn't add anything, they've been strings already, now you have them represented in two places. It's the same problem SecureString has, byte arrays are only useful if you control the input mechanism.
So sure, in theory yes, in practice it adds nothing.
But what if I am controlling the input mechanism?
In my case, password is a PIN typed on a randomized virtual keyboard. The http request just has the position on the keyboard, not the value. After decoding the position, I am able to provide a byte array without passing by a string.
Then you're way outside what we expect identity to be used for.
Also, if an attacker is at the point where they can execute code to start dumping memory they're at the point where they can run anything on your server, so they can intercept requests, change responses, connect to your database and so on. This is solved by hardening your infrastructure, not by changing strings to byte arrays.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
My security team escalated to me that the
PasswordHasher
is vulnerable to heap inspection, as the password is of typeString
.It should be instead a byte array / span of bytes cleared at the end of the process, as it is done by any cryptographic operation in corefx. CC @bartonjs.
Same problem with any password related types (
IPasswordValidator
, and maybe also theIUserPasswordStore
)The text was updated successfully, but these errors were encountered: