[MDEV-20466] SHOW PROCESSLIST truncates query text on \0 bytes Created: 2019-09-02 Updated: 2020-05-11 Resolved: 2019-10-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.3.17, 10.4.7, 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.2.28, 5.5.66, 10.1.42, 10.3.19, 10.4.9 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Hartmut Holzgraefe | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
When executing a query with a NUL byte ('\0') in it, SHOW PROCESSLIST will just show the query up to that byte, hiding the rest of the query. In the slow query log, on the other hand, This can be used by a malicious user to try to hide SQL injection attacks.
|
| Comments |
| Comment by Sergei Golubchik [ 2019-09-02 ] | |||||||||||||||||||||||||||||||
|
I wonder, whether it's really SHOW PROCESSLIST, that truncates or mysql client itself? | |||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2019-09-02 ] | |||||||||||||||||||||||||||||||
|
and whether I_S.PROCESSLIST does the same. One can use HEX() on the Info column there | |||||||||||||||||||||||||||||||
| Comment by Alice Sherepa [ 2019-09-02 ] | |||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2019-09-02 ] | |||||||||||||||||||||||||||||||
|
So it may indeed be a client side problem | |||||||||||||||||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2019-09-02 ] | |||||||||||||||||||||||||||||||
|
No, wireshark clearly shows that the query string is terminated after "root" on the sending side already:
| |||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2019-10-14 ] | |||||||||||||||||||||||||||||||
|
correct test case for the bug without waiting (sleep(3) actually do not cause waiting, connection will just be closed)
|