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

Published Mar 4, 2024
·
Updated

Impact

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.

Patches

The problem is resolved in v4.18.2 and v5.5.4.

Workarounds

Reject user input large enough to cause a single query or bind message to exceed 4 GB in size.

Other sources

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.

MITRE

pgx SQL Injection via Protocol Message Size Overflow

Microsoft

Affected Software

14 affected componentsFixes available
go/github.com/jackc/pgx/v5>=5.0.0<5.5.4
5.5.4
go/github.com/jackc/pgx/v4<4.18.2
4.18.2
go/github.com/jackc/pgx>=5.0.0<5.5.4
5.5.4
go/github.com/jackc/pgx<4.18.2
4.18.2
IBM Edge Application Manager<=4.5
Microsoft azl3 telegraf 1.29.4-1
Microsoft cbl2 telegraf 1.28.5-5
Microsoft azl3 telegraf 1.31.0-1
redhat/pgx<4.18.2
4.18.2
redhat/pgx<5.5.4
5.5.4
redhat/pgproto3<2.3.3
2.3.3
jackc Pgproto3 Go<2.3.3
jackc Pgx Go<4.18.2
jackc Pgx Go>=5.0.0<5.5.4

Event History

Mar 4, 2024
Advisory Published
via GitHub·08:43 PM
Mar 6, 2024
CVE Published
via MITRE·07:07 PM
Data Sourced
via MITRE·07:07 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·07:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·07:15 PM
RemedyAffected Software
Data Sourced
via Red Hat·08:43 PM
DescriptionSeverityAffected Software
Jun 30, 2024
Data Sourced
via Microsoft·02:00 PM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·02:00 PM
Affected Software
Updated
via Microsoft·02:00 PM
DescriptionSeverity
Aug 20, 2025
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-27304?

The severity of CVE-2024-27304 is high due to the potential for SQL injection attacks.

2

How do I fix CVE-2024-27304?

To fix CVE-2024-27304, upgrade to pgx version 4.18.2, pgproto3 version 2.3.3, or appropriate versions of the affected packages as outlined in the vulnerability report.

3

What software is affected by CVE-2024-27304?

CVE-2024-27304 affects the pgx and pgproto3 packages in various versions.

4

Can an attacker exploit CVE-2024-27304 remotely?

Yes, an attacker can exploit CVE-2024-27304 remotely if they can send a maliciously crafted query.

5

What type of attack can result from CVE-2024-27304?

CVE-2024-27304 can lead to SQL injection attacks due to an integer overflow in message size calculation.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203