Actions
Bug #10988
closed[PATCH] Raise ArgumentError when string passed to String#crypt contains null
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
2.3.0dev
Description
Currently String#crypt assumes that it is called on a password typed
by the user, specifically, that it does not contain null character.
When it does:
"abc\0def".crypt("pass") == "abc".crypt("pass")
=> true
This may not be desirable, and developers invoking crypt on strings
that potentially include null may expect different results. To
prevent security failures, this patch changes String#crypt to throw
ArgumentError when invoked on String that includes null character.
https://www.reddit.com/r/netsec/comments/2yugos/null_bytes_bcrypt_problem/
Files
Actions
Like0
Like0Like0Like0Like0