Skip to content
Fencer Vulns
critical 9.8

CVE-2024-27304 json

pgx SQL Injection via Protocol Message Size Overflow

published 2024-03-04 2 y ago modified 2026-09-10 1 mo ago also GHSA-7jwh-3vrq-q3m8 , GHSA-mrww-27vc-gghv , GO-2024-2606 , EUVD-2024-0972

cvss
9.8
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
1.1%
EPSS 1.1% chance of exploitation in 30 days, percentile 66%
public exploits
0
none known

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 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.

Patch / fix

  • go github.com/jackc/pgx 4.18.2, 5.5.4
  • go github.com/jackc/pgx/v4 4.18.2
  • go github.com/jackc/pgx/v5 5.5.4
  • go github.com/jackc/pgproto3 2.3.3
  • go github.com/jackc/pgproto3/v2 2.3.3
  • jackc pgx 4.18.2, 5.5.4
  • golang-github-jackc-pgx Debian 14, Debian 13 4.18.1-2
  • golang-github-jackc-pgconn Debian 14 1.14.3-1

debian advisories DEBIAN-CVE-2024-27304

  • telegraf Azure Linux 3.0 1.31.0-1
  • telegraf CBL-Mariner 2.0 1.28.5-5

azure linux advisories AZL-35752AZL-35762

Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2024-27304 updated cvss 8.1

pgx: SQL Injection via Protocol Message Size Overflow

  • Red Hat Migration Toolkit for Applications 6 mta/mta-hub-rhel8, mta/mta-windup-addon-rhel8
    affected: no fix planned “Will not fix”
  • Red Hat Advanced Cluster Security 3 advanced-cluster-security/rhacs-main-rhel8, advanced-cluster-security/rhacs-roxctl-rhel8, advanced-cluster-security/rhacs-rhel8-operator, advanced-cluster-security/rhacs-central-db-rhel8
    affected: no fix planned “Out of support scope”
  • Red Hat Ansible Automation Platform 2 aap-cloud-ui-container Red Hat Enterprise Linux 8 osbuild-composer, osbuild-composer-core, osbuild-composer-worker, osbuild-composer-dnf-json Red Hat Enterprise Linux 9 osbuild-composer, osbuild-composer-core, osbuild-composer-worker, osbuild-composer-dnf-json
    affected: no fix planned “Will not fix”
  • Red Hat OpenShift Container Platform 4 openshift4/ose-agent-installer-api-server-rhel9, openshift4/ose-agent-installer-node-agent-rhel8, openshift4/ose-agent-installer-csr-approver-rhel9, openshift4/ose-agent-installer-orchestrator-rhel8 Red Hat OpenShift Container Platform Assisted Installer 1 rhai-tech-preview/assisted-installer-rhel8, rhai-tech-preview/assisted-installer-agent-rhel8, rhai-tech-preview/assisted-installer-reporter-rhel8 Red Hat Openshift Container Storage 4 ocs4/cephcsi-rhel8, ocs4/mcg-rhel8-operator, ocs4/ocs-rhel8-operator, ocs4/ocs-must-gather-rhel8 Red Hat OpenShift Data Science (RHODS) rhods/odh-operator-base-rhel8, rhods/odh-ml-pipelines-cache-rhel8, rhods/odh-ml-pipelines-api-server-rhel8, rhods/odh-ml-pipelines-artifact-manager-rhel8, rhods/odh-ml-pipelines-persistenceagent-rhel8, rhods/odh-ml-pipelines-scheduledworkflow-rhel8
    affected: no fix available
  • Red Hat OpenShift on AWS rosa Red Hat OpenStack Platform 16.2 osp-director-provisioner-container
    affected: no fix planned “Will not fix”
  • Red Hat Quay 3 quay/quay-rhel8, quay/clair-rhel8, quay/quay-operator-rhel8
    affected: no fix available
  • Red Hat RHACS 4.3 for RHEL 8 advanced-cluster-security/rhacs-main-rhel8 4.3.5-4, advanced-cluster-security/rhacs-roxctl-rhel8 4.3.5-3, advanced-cluster-security/rhacs-scanner-rhel8 4.3.5-3, advanced-cluster-security/rhacs-rhel8-operator 4.3.5-3, advanced-cluster-security/rhacs-collector-rhel8 4.3.5-3, advanced-cluster-security/rhacs-operator-bundle 4.3.5-4, +5 more
    fixed: vendor fix RHSA-2024:1321
  • Red Hat Multicluster Engine for Kubernetes multicluster-engine/agent-service-rhel8, multicluster-engine/assisted-installer-rhel8, multicluster-engine/assisted-installer-agent-rhel8, multicluster-engine/assisted-installer-reporter-rhel8 Red Hat Advanced Cluster Management for Kubernetes 2 rhacm2/acm-search-v2-api-rhel9, rhacm2/acm-search-indexer-rhel8 Red Hat Openshift Data Foundation 4 odf4/rook-ceph-rhel9-operator
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
yes
Technical impact
partial
Assessed
2 y ago

Exploit prediction

1.11% chance of exploitation in the next 30 days, higher than 66% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
go github.com/jackc/pgx
<4.18.2
>=5.0.0, <5.5.4
all versions
4.18.2
5.5.4
go github.com/jackc/pgx/v4
<4.18.2
4.18.2
go github.com/jackc/pgx/v5
>=5.0.0, <5.5.4
5.5.4
go github.com/jackc/pgproto3
<2.3.3
2.3.3
go github.com/jackc/pgproto3/v2
<2.3.3
2.3.3

Affected products

  • jackc pgx

Classification

Weakness
  • CWE-89 Improper Neutralization of Special Elements used in an SQL Command
  • CWE-190 Integer Overflow or Wraparound

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.