🇰🇷 한글 설명
ProxySQL 2.0.0부터 3.0.8 버전에서 PROXY protocol v1의 'UNKNOWN' 토큰 처리 오류로 인해 소스 IP 주소를 위조할 수 있는 취약점이 발견되었습니다. 공격자는 PP1 프레임에 임의의 IP를 삽입하여 ProxySQL의 ACL 및 쿼리 라우팅 규칙을 우회하고 권한이 없는 데이터베이스 경로에 접근할 수 있습니다.
💡 쉬운 설명
ProxySQL이 접속자의 실제 주소를 확인하지 않고, 접속자가 거짓으로 말하는 주소를 그대로 믿어버리는 문제입니다. 이를 통해 공격자는 마치 관리자처럼 속여서 데이터베이스의 중요한 규칙들을 무시하고 접근할 수 있습니다.
🇺🇸 원문 (English)
ProxySQL is a proxy for MySQL and its forks, as well as PostgreSQL. In versions 2.0.0 through 3.0.8, the ProxySQL MySQL frontend accepts the `PROXY UNKNOWN <addr> <addr> <port> <port>\r\n` PP1 frame as a well-formed PROXY protocol header. The HAProxy PROXY protocol v1 specification says that when the protocol token is `UNKNOWN`, the receiver MUST ignore any address fields that follow it, because the proxy has declared it cannot determine the client identity. ProxySQL parses those address fields anyway via `sscanf` and writes the spoofed source address into the session's `addr.addr` field. From there it flows directly into the query-rule matcher, where the `client_addr` predicate decides routing and ACL. When `mysql-proxy_protocol_networks = '*'` (the default), any TCP peer can send a PP1 frame and choose any source IP claim. With that, any `mysql_query_rules` row pinned to a `client_addr` value is forgeable: the attacker writes the address they want to match into the PP1 line, and ProxySQL routes their query as if it came from that address. In practice this is a routing and ACL bypass. Real deployments use `client_addr` for read-write splitting (internal apps go to the primary, public traffic to read replicas), per-app schema pinning, and query-filter rules (DDL allowed only from admin CIDR, public queries blocked from dangerous patterns). An attacker that can reach the frontend port can forge their way into any of those routes. Version 3.0.9 patches this issue.
📍 영향받는 시스템
ProxySQL versions 2.0.0 through 3.0.8
⚔️ 공격 벡터
조작된 PROXY protocol v1(PP1) 프레임을 전송하여 클라이언트 IP 주소를 위조함
🛡️ 대응 방법
ProxySQL을 보안 패치가 적용된 버전인 3.0.9 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 ProxySQL의 버전이 2.0.0에서 3.0.8 사이인지 확인하십시오.
proxysql --version 2>/dev/null || dpkg -l | grep proxysql