What’s Vulnerable › Vulnerabilities

CVE-2024-27304: pgx SQL Injection via Protocol Message Size Overflow

Description

pgx is a PostgreSQL driver and toolkit for Go. SQL injection can occur if an attacker can cause a single query or bind message to exceed 4 GB in size. An integer overflow in the calculated message size can cause the one large message to be sent as multiple messages under the attacker's control. The problem is resolved in v4.18.2 and v5.5.4. As a workaround, reject user input large enough to cause a single query or bind message to exceed 4 GB in size.

Affected products

How to fix

Upgrade to a fixed version: github.com/jackc/pgproto3/v2 2.3.3; jackc pgx 4.18.2, 5.5.4. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2024-27304 or the next vulnerability affects your stack