# CVE-2024-27304: GO-2024-2606 - SQL injection in github.com/jackc/pgproto3 and github.com/jackc/pgx

Source: https://junglewise.ai/threats/cve-2024-27304-pgproto3-sql-injection-via-protocol-message-size-overflow  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-03-14  
License: CC BY 4.0 with a link back

CVE-2024-27304 · Severity: low · CVSS 3.1 · Published 2024-03-14

SQL injection in github.com/jackc/pgproto3 and github.com/jackc/pgx

Technologies: [github.com/jackc/pgproto3/v2 (Go)](https://junglewise.ai/threats/technologies/github-com-jackc-pgproto3-v2), [github.com/jackc/pgx (Go)](https://junglewise.ai/threats/technologies/github-com-jackc-pgx), [github.com/jackc/pgx/v4 (Go)](https://junglewise.ai/threats/technologies/github-com-jackc-pgx-v4), [github.com/jackc/pgx/v5 (Go)](https://junglewise.ai/threats/technologies/github-com-jackc-pgx-v5). Vendors: [Go](https://junglewise.ai/threats/vendors/go).

## Quick answers

**Is CVE-2024-27304 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-27304 being exploited in the wild.

**How severe is CVE-2024-27304?** Low severity, with a CVSS score of 3.1, published 14 March 2024.

**Which products and versions are affected?** github.com/jackc/pgproto3 (Go) SEMVER:introduced=0,fixed=2.3.3; github.com/jackc/pgproto3/v2 (Go) SEMVER:introduced=0,fixed=2.3.3; github.com/jackc/pgx (Go) SEMVER:introduced=0, SEMVER:introduced=0,fixed=4.18.2; github.com/jackc/pgx/v4 (Go) SEMVER:introduced=0,fixed=4.18.2; and 1 more.

**Is there a fix for CVE-2024-27304?** Yes. github.com/jackc/pgproto3 (Go): upgrade to 2.3.3 or later; github.com/jackc/pgproto3/v2 (Go): upgrade to 2.3.3 or later; github.com/jackc/pgx (Go): upgrade to 4.18.2 or later; github.com/jackc/pgx/v4 (Go): upgrade to 4.18.2 or later; github.com/jackc/pgx/v5 (Go): upgrade to 5.5.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2024-27304?** Check whether you run github.com/jackc/pgproto3 (Go), github.com/jackc/pgproto3/v2 (Go), github.com/jackc/pgx (Go) or one of the others listed at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- github.com/jackc/pgproto3 (Go): upgrade to 2.3.3 or later

  ```sh
  go get github.com/jackc/pgproto3@v2.3.3
  ```

- github.com/jackc/pgproto3/v2 (Go): upgrade to 2.3.3 or later

  ```sh
  go get github.com/jackc/pgproto3/v2@v2.3.3
  ```

- github.com/jackc/pgx (Go): upgrade to 4.18.2 or later

  ```sh
  go get github.com/jackc/pgx@v4.18.2
  ```

- github.com/jackc/pgx/v4 (Go): upgrade to 4.18.2 or later

  ```sh
  go get github.com/jackc/pgx/v4@v4.18.2
  ```

- github.com/jackc/pgx/v5 (Go): upgrade to 5.5.4 or later

  ```sh
  go get github.com/jackc/pgx/v5@v5.5.4
  ```


## Affected products

- github.com/jackc/pgproto3 (Go) SEMVER:introduced=0,fixed=2.3.3
- github.com/jackc/pgproto3/v2 (Go) SEMVER:introduced=0,fixed=2.3.3
- github.com/jackc/pgx (Go) SEMVER:introduced=0, SEMVER:introduced=0,fixed=4.18.2
- github.com/jackc/pgx/v4 (Go) SEMVER:introduced=0,fixed=4.18.2
- github.com/jackc/pgx/v5 (Go) SEMVER:introduced=5.0.0,fixed=5.5.4

## Identifiers

- CVE-2024-27304
- GHSA-7jwh-3vrq-q3m8
- GHSA-mrww-27vc-gghv
- GO-2024-2606

## Related threats

- [jackc pgx SQL injection in simple protocol sanitizer](https://junglewise.ai/threats/cve-2026-41889-jackc-pgx-sql-injection-in-simple-protocol-sanitizer)
- [jackc pgx memory safety vulnerability in pgproto3](https://junglewise.ai/threats/cve-2026-33816-jackc-pgx-memory-safety-vulnerability-in-pgproto3)
- [Jackc pgx memory-safety vulnerability in pgproto3](https://junglewise.ai/threats/cve-2026-33815-jackc-pgx-memory-safety-vulnerability-in-pgproto3)
- [Jackc pgproto3 denial of service in DataRow.Decode](https://junglewise.ai/threats/cve-2026-32286-jackc-pgproto3-denial-of-service-in-datarow-decode)
- [Duplicate Advisory: pgproto3: Negative field length panics in DataRow.Decode](https://junglewise.ai/threats/cve-2026-4427-duplicate-advisory-pgproto3-negative-field-length-panics-in)
