-
Notifications
You must be signed in to change notification settings - Fork 7.8k
mysqli::real_connect(): Authentication data too long. Won't fit into the buffer and will be truncated. Authentication will thus fail #10800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@kamil-tekiela Can you help here? I couldn't find any documentation on password limits, but I also don't know mysql well. |
I want to say that I saw a comment somewhere a while back that said the actual length limit was based on stack size, but I can’t seem to find anything now. If a good answer can’t be found, can I suggest that this message only be presented if authentication fails? |
@maemigh I see. That would depend on whether the stack will overflow or mariadb will catch this and report an error. Let's see if somebody who knows MariaDB/MySQL better can answer that. |
Just thought of chiming in here quickly to drop the following info because coincidentally I already played with this code and I happen to know where this comes from. Pretty sure this comes from here: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c Line 491 in b6ceae3
That hardcoded buffer size is defined here: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c Line 485 in b6ceae3
AFAIK mysql passwords can be arbitrarily long (as long as they fit in the datatype ofc), so this might need a dynamic allocation (fallback). |
I had a brief look at it now. It's a bit strange. Technically, the error is correct. The MySQL packet specification allocates one byte for the length of the authentication data (auth_response_length) which means that the max length can be 255 bytes. But as can be seen in the documentation, the flag For the most common use case |
Description
I'm using JWT tokens as passwords for MariaDB (via PAM auth) and while using phpmyadmin 5.2.1 I see this message pop up. However, even though the message appears authentication does succeed.
It looks like mysqlnd_wireprotocol.c will set this message if (packet->auth_data_len > 0xFF)
Passwords can actually be extremely long though.
PHP Version
PHP 8.1.15
Operating System
No response
The text was updated successfully, but these errors were encountered: