php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72638 client fails to set "CLIENT_CONNECT_ATTRS" in capability flag
Submitted: 2016-07-21 02:43 UTC Modified: -
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: littlewintergrass at gmail dot com Assigned:
Status: Open Package: MySQL related
PHP Version: Irrelevant OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: littlewintergrass at gmail dot com
New email:
PHP Version: OS:

 

 [2016-07-21 02:43 UTC] littlewintergrass at gmail dot com
Description:
------------
Client will send handshake response to MySQL server after receiving server greeting packet.

mysqlnd extension adds client attribute "_client_name" as "mysqlnd" in the handshake response packet:
https://github.com/php/php-src/blob/master/ext/mysqlnd/mysqlnd_connection.c#L834

According to MySQL protocol, client should set "CLIENT_CONNECT_ATTRS" bit in its capability flag if any client attribute is added:
http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse41
http://dev.mysql.com/doc/internals/en/capability-flags.html#flag-CLIENT_CONNECT_ATTRS

However it is never set in handshake response.
The macro is defined here:
https://github.com/php/php-src/blob/master/ext/mysqlnd/mysqlnd_enum_n_def.h#L102

For those MySQL servers that strictly follow the protocol, this will cause packet parsing failure.



Patches

fix-connection-attributes-in-mysqlnd (last revision 2016-11-16 15:22 UTC by mateusz dot kijowski at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Dec 06 08:01:24 2019 UTC