/

CVE-2026-48772

Severity:

CRITICAL RISK

(10.0)

PROXY Protocol Parsing (CWE-348) in ProxySQL ACLs

CVE-2026-48772

Analyzed

Vulnerability type

Category:

Improper Certificate or Authentication Validation

CWE:

CWE-348, CWE-863

Impact:

Authentication and ACL Bypass via Source IP Spoofing

Severity:

CRITICAL RISK

(10.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

ProxySQL incorrectly parses HAProxy PROXY protocol v1 UNKNOWN headers and treats user-supplied address fields as trusted client IP information.

An attacker who can connect to the MySQL frontend port can forge arbitrary source IPs, bypassing routing logic and IP-based access controls that rely on client_addr.

Affected context

The vulnerability occurs in ProxySQL deployments that:

  • Enable the MySQL frontend and accept HAProxy PROXY protocol v1 frames
  • Use the default mysql-proxy_protocol_networks = '*', or otherwise permit untrusted peers to send PROXY headers
  • Rely on client_addr in mysql_query_rules for routing, access control, or query filtering

In such contexts, ProxySQL treats address fields in PROXY UNKNOWN frames as if they were trustworthy client IPs, even though the PROXY protocol specification states they must be ignored.

Exploit preconditions

  • Attack surface: ProxySQL MySQL frontend port that accepts PROXY protocol v1 frames
  • Required access: Network-level ability to open a TCP connection to the frontend (no prior authentication needed)
  • Trigger point: Sending a crafted PROXY protocol v1 line using the PROXY UNKNOWN <addr> <addr> <port> <port>\r\n format before the MySQL handshake
  • Why exploitation is possible: ProxySQL parses and stores the address fields from UNKNOWN frames via sscanf, contrary to the specification, and propagates the spoofed IP into client_addr for routing and ACL decisions.

Why this happens

The core issue is that ProxySQL violates the semantics of the HAProxy PROXY protocol v1 when handling PROXY UNKNOWN headers.

Instead of discarding any following address fields as mandated by the spec, the implementation parses them with sscanf and populates the session's addr.addr field from attacker-controlled data.

This behavior maps to CWE-348: Use of Insufficiently Secure Credentials, where a component accepts untrusted identity claims (in this case, a claimed client IP) without appropriate validation, and to aspects of CWE-863: Incorrect Authorization because authorization and routing decisions are made on forged identity attributes.

Abstractly, the bug is an insecure trust boundary: metadata intended to be non-authoritative is treated as a primary authentication and policy input.

Potential impact

  • Bypass of IP-based access control lists (ACLs) that rely on client_addr
  • Unauthorized routing of queries to internal-only backends or primary nodes
  • Circumvention of query-filter rules that are restricted to specific CIDRs (for example, DDL-only-from-admin networks)
  • Misrouting of multi-tenant or per-application traffic, leading to data exposure across logical boundaries
  • Escalation of privileges within the database environment by impersonating trusted application or admin networks

General mitigation guidance

Effective mitigation focuses on tightening trust boundaries around PROXY protocol input and removing IP-based identity assumptions:

  • Treat PROXY protocol headers from untrusted networks as untrusted metadata and disable them where not strictly required.
  • Restrict mysql-proxy_protocol_networks to explicit, tightly controlled proxy IP ranges instead of permissive wildcards.
  • Avoid using client_addr as the sole authentication or authorization factor; combine it with stronger credentials or connection attributes.
  • Prefer application-level authentication and role-based authorization over network-origin-based routing for sensitive operations.
  • Design routing and ACL policies so that misclassification of client IP cannot alone grant high-privilege access (defense in depth).

How teams detect issues like this

Organizations can detect and monitor this pattern through a combination of configuration and behavioral analysis:

  • Static/config review: Flag deployments where mysql-proxy_protocol_networks is '*' or includes broad network ranges, especially when mysql_query_rules rely heavily on client_addr.
  • Code and design review: Examine places where connection metadata (e.g., claimed client IP) is treated as authoritative identity for ACLs or routing, validating that the upstream source is trusted.
  • Runtime monitoring: Analyze logs for unusual or impossible client IP patterns (e.g., public users appearing to originate from internal-only CIDRs or admin subnets).
  • Automated policy checks: Use configuration linting or security-as-code tools to enforce policies that disallow PROXY protocol trust from unverified peers and highlight IP-based authorization rules.

Sources

SourceLink
github.comgithub.com/sysown/proxysql/releases/tag/v3.0.9
github.comgithub.com/sysown/proxysql/security/advisories/GHSA-gw94-85m2-x8v2

Frequently asked

questions

It is broadly exploitable wherever an attacker can reach the ProxySQL MySQL frontend port and the service accepts PROXY protocol v1 headers, particularly with permissive mysql-proxy_protocol_networks settings.

The spoofing of client_addr occurs before query routing and ACL decisions; while credentials may still be required to authenticate to the backend, the attacker can use forged IP information to reach backends or routes that were intended to be inaccessible to them.

Enforce strict trust boundaries for PROXY protocol headers by accepting them only from known, controlled proxies, and ensure the implementation follows the protocol specification, especially ignoring address fields for UNKNOWN frames.

Treat all externally supplied metadata, including protocol headers, as untrusted by default; validate behavior against protocol specifications during implementation and review, avoid using IP address as a primary authentication factor, and codify configuration checks that detect insecure identity assumptions in routing or ACL logic.

Find out what's already
exploitable in your codebase.