Bug #86357 | my_make_scrambled_password() changed behavior, can overflow buffer | ||
---|---|---|---|
Submitted: | 17 May 2017 14:28 | Modified: | 19 May 2017 8:23 |
Reporter: | Andreas Hasenack | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 5.7.18 | OS: | Ubuntu |
Assigned to: | CPU Architecture: | Any |
[17 May 2017 14:28]
Andreas Hasenack
[17 May 2017 16:27]
MySQL Verification Team
Hi! We never maintained backward compatibility on this issue. But, we have had it under control with mysql_upgrade and, internally, with some other data. We are duly maintaining our protocol versions, capability flags and other info, which enables external programs to know EXACTLY what to expect. However, this might need additional documentation, most likely in our "Internals Manual". Hence, I am verifying it as a documentation bug.
[17 May 2017 16:56]
Andreas Hasenack
Thanks for the response. I want to note that I think there is currently no function exported in the mysqlclient library that creates the same hash as the server SQL PASSWORD() one.
[18 May 2017 8:33]
Norvald Ryeng
Posted by developer: Hi Andreas, Just to recap what happened here: As you say, my_make_scrambled_password changed behavior between 5.5 and 5.6. The old behavior is what is now implemented by my_make_scrambled_password_sha1. In addition, there's make_scrambled_password that is an alias for the old behavior of my_make_scrambled_password (updated to call my_make_scrambled_password_sha1 when the behavior changed). All of these are internal functions that were never meant to be used by third parties, so they were not tracked for ABI breakage. But, unfortunately, the library still exported the symbols, so they ended up being used by a few applications. So we now have these 3 functions: my_make_scrambled_password: changed behavior between 5.5 and 5.6 my_make_scrambled_password_sha1: the 5.5 behavior of my_make_scrambled_password (new in 5.6) make_scrambled_password: the 5.5 behavior (in all versions) In the initial GA release of 5.7, none of these were exported. During the upgrade from 5.6 to 5.7 in Ubuntu, we got a request to reintroduce one of these (bug #80974), and we added the my_make_scrambled_password function to the export list. In the choice between make_scrambled_password and my_make_scrambled_password, we chose the latter since it uses a more modern hashing algorithm. Since this function was unchanged from 5.6, which was already in Ubuntu, no further inspection of the implementation was done. It was assumed that the 5.6 implementation was what the applications wanted. The my_make_scrambled_password function hasn't changed behavior after it was added to the ABI in 5.7. The symbol will be removed in a future release.
[19 May 2017 8:23]
Georgi Kodinov
Posted by developer: MY_MAKE_SCRAMBLED_PASSWORD was never a part of the official C API and is an internal function. These can change and are not bound to the C API version.