---
id: CVE-2024-27304
title: 'pgx: SQL Injection via Protocol Message Size Overflow (CVE-2024-27304)'
summary: >-
  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…
severity: high
cvss: 8.1
cvssVector: 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H'
cvssSource: vendor
cwe: CWE-89
vendor: Red Hat
product: RHACS 4.3 for RHEL 8
affected:
  - migration_toolkit_for_applications 6
  - advanced_cluster_security 3
  - ansible_automation_platform 2
  - enterprise_linux 8
  - enterprise_linux 9
  - openshift_container_platform 4
  - openshift_container_platform_assisted_installer 1
  - openshift_container_storage 4
  - openshift_data_science_rhods
  - openshift_on_aws
  - openstack_platform 16.2
  - quay 3
  - rhacs_4_3_for_rhel 8
patched:
  - rhacs_4_3_for_rhel 8
published: '2024-03-06'
updated: '2026-09-19'
sourceUpdated: '2026-09-19T11:42:52+00:00'
source: CSAF
sourceUrl: 'https://security.access.redhat.com/data/csaf/v2/vex/2024/cve-2024-27304.json'
references:
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2024/cve-2024-27304.json
  - url: 'https://access.redhat.com/security/cve/CVE-2024-27304'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2268269'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2024-27304'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2024-27304'
  - url: 'https://access.redhat.com/errata/RHSA-2024:1321'
  - url: 'https://github.com/jackc/pgproto3/security/advisories/GHSA-7jwh-3vrq-q3m8'
  - url: 'https://github.com/jackc/pgx/security/advisories/GHSA-mrww-27vc-gghv'
  - url: >-
      https://github.com/jackc/pgproto3/commit/945c2126f6db8f3bea7eeebe307c01fe92bca007
  - url: >-
      https://github.com/jackc/pgx/commit/adbb38f298c76e283ffc7c7a3f571036fea47fd4
  - url: >-
      https://github.com/jackc/pgx/commit/c543134753a0c5d22881c12404025724cb05ffd8
  - url: >-
      https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df
  - url: 'https://github.com/jackc/pgproto3'
tags:
  - csaf
  - vex
  - red-hat
  - exploit-available
  - osv
  - go
epss: 0.01109
epssPercentile: 0.64474
exploits:
  github: 1
  githubRepos:
    - 'https://github.com/roaris/CVE-2024-27304-PoC'
  checkedAt: '2026-09-26T09:05:31.143Z'
exploitAvailable: true
aliases:
  - GHSA-7jwh-3vrq-q3m8
  - GHSA-mrww-27vc-gghv
  - GO-2024-2606
ecosystem: go
scores:
  vendor: 8.1
  osv: 9.8
ingestedAt: '2026-09-12T03:13:01.764Z'
---

## Overview

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.

## Vendor advisories

- **RHSA-2024:1321** · Red Hat · fixed in: RHACS 4.3 for RHEL 8 · released 2024-03-13 · [advisory](https://access.redhat.com/errata/RHSA-2024:1321)
- **Red Hat VEX** · Moderate · affected: Migration Toolkit for Applications 6, Red Hat Advanced Cluster Security 3, Red Hat Ansible Automation Platform 2, Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9, Red Hat OpenShift Container Platform 4, … · no fix planned: Red Hat Advanced Cluster Security 3, Migration Toolkit for Applications 6, Red Hat Ansible Automation Platform 2, Red Hat Enterprise Linux 8, … · updated 2026-09-19 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2024/cve-2024-27304.json)

**pgx: SQL Injection via Protocol Message Size Overflow** — rated Moderate by Red Hat. Released 2024-03-06, updated 2026-09-19.

Affected:

- Migration Toolkit for Applications 6
- Red Hat Advanced Cluster Security 3
- Red Hat Ansible Automation Platform 2
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat OpenShift Container Platform 4
- Red Hat OpenShift Container Platform Assisted Installer 1
- Red Hat Openshift Container Storage 4
- Red Hat OpenShift Data Science (RHODS)
- Red Hat OpenShift on AWS
- Red Hat OpenStack Platform 16.2
- Red Hat Quay 3

Fixed:

- RHACS 4.3 for RHEL 8

No fix planned:

- Red Hat Advanced Cluster Security 3
- Migration Toolkit for Applications 6
- Red Hat Ansible Automation Platform 2
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat OpenShift on AWS
- Red Hat OpenStack Platform 16.2
- Red Hat OpenShift Container Platform 4
- Red Hat OpenShift Container Platform Assisted Installer 1
- Red Hat Openshift Container Storage 4
- Red Hat OpenShift Data Science (RHODS)
- Red Hat Quay 3

Not affected:

- Multicluster Engine for Kubernetes
- Red Hat Advanced Cluster Management for Kubernetes 2
- Red Hat Openshift Data Foundation 4

## Remediation

If you are using an earlier version of RHACS 4.3, you are advised to upgrade to patch release 4.3.5. https://access.redhat.com/errata/RHSA-2024:1321

## Package advisory (CVE-2024-27304)

Affected packages:

- `github.com/jackc/pgproto3 < 2.3.3`
- `github.com/jackc/pgproto3/v2 < 2.3.3`

Patched in:

- `github.com/jackc/pgproto3 2.3.3`
- `github.com/jackc/pgproto3/v2 2.3.3`

Source: https://osv.dev/vulnerability/GHSA-7jwh-3vrq-q3m8
