There is a potential buffer overflow vulnerability in the ProxySQL_Cluster::pull_mysql_servers_v2_from_peer function within the ProxySQL_Cluster.cpp file. Specifically, in the code that inserts data into the mysql_servers table, the memory allocation for the query string uses an incorrect variable, which could lead to insufficient memory allocation and subsequent buffer overflow.
ProxySQL Version
v2.x
Steps to Reproduce
Open the ProxySQL_Cluster.cpp file.
Locate the ProxySQL_Cluster::pull_mysql_servers_v2_from_peer function.
thanks for the clear report, the issue you mention and other similar cases should be now handle in PR #4573. This issue will be closed when the PR is merged.
Description of the Issue
There is a potential buffer overflow vulnerability in the
ProxySQL_Cluster::pull_mysql_servers_v2_from_peer
function within theProxySQL_Cluster.cpp
file. Specifically, in the code that inserts data into themysql_servers
table, the memory allocation for the query string uses an incorrect variable, which could lead to insufficient memory allocation and subsequent buffer overflow.ProxySQL Version
v2.x
Steps to Reproduce
ProxySQL_Cluster.cpp
file.ProxySQL_Cluster::pull_mysql_servers_v2_from_peer
function.Proposed Fix
Replace the line:
with: