pgx SQL Injection via Line Comment Creation
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- SQL injection
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 3 fixed, 9 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-89.
Summary
pgx is a PostgreSQL driver and toolkit for Go. Prior to version 4.18.2, SQL injection can occur when all of the following conditions are met: the non-default simple protocol is used; a placeholder for a numeric value must be immediately preceded by a minus; there must be a second placeholder for a string value after the first placeholder; both must be on the same line; and both parameter values must be user-controlled. The problem is resolved in v4.18.2. As a workaround, do not use the simple protocol or do not place a minus directly before a placeholder.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| jackc | pgx | before 4.18.2 | 4.18.2 | Patch available | CNA |
| — | github.com/jackc/pgx (Go) | before 4.18.2 | 4.18.2 | Patch available | GHSA-m7wr-2xf7-cm9p |
| — | github.com/jackc/pgx/v4 (Go) | before 4.18.2 | 4.18.2 | Patch available | GHSA-m7wr-2xf7-cm9p |
- pgx Vendorjackc Affected before 4.18.2 Fixed in 4.18.2 Patch available CNA
- github.com/jackc/pgx (Go) Vendor— Affected before 4.18.2 Fixed in 4.18.2 Patch available GHSA-m7wr-2xf7-cm9p
- github.com/jackc/pgx/v4 (Go) Vendor— Affected before 4.18.2 Fixed in 4.18.2 Patch available GHSA-m7wr-2xf7-cm9p
Remediation
- Fix · CNA pgx (jackc) Fixed in 4.18.2
- Fix · GHSA-m7wr-2xf7-cm9p github.com/jackc/pgx (Go) Fixed in 4.18.2 Advisory →
- Fix · GHSA-m7wr-2xf7-cm9p github.com/jackc/pgx/v4 (Go) Fixed in 4.18.2 Advisory →
Red Hat 3 advisories
- RHSA-2024:7944 Released 2024-10-16 · Red Hat rating ModerateOpenShift Container Platform 4.16.17 security update
- Red Hat OpenShift Container Platform 4.16 openshift4/ose-agent-installer-csr-approver-rhel9
- RHSA-2024:7922 Released 2024-10-16 · Red Hat rating ImportantOpenShift Container Platform 4.17.1 bug fix and security update
- Red Hat OpenShift Container Platform 4.17 openshift4/aws-kms-encryption-provider-rhel9, openshift4/azure-kms-encryption-provider-rhel9, openshift4/cloud-network-config-controller-rhel9 +47
- RHSA-2024:1321 Released 2024-03-13 · Red Hat rating ModerateACS 4.3 enhancement and security update
- RHACS 4.3 for RHEL 8 advanced-cluster-security/rhacs-central-db-rhel8, advanced-cluster-security/rhacs-collector-rhel8, advanced-cluster-security/rhacs-collector-slim-rhel8 +8
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Multicluster Engine for Kubernetes | Affected | No fix yet |
| Red Hat Advanced Cluster Security 3 | Affected | No fix planned: Will not fix |
| Red Hat Ansible Automation Platform 2 | Affected | No fix planned: Will not fix |
| Red Hat Enterprise Linux 10 | Affected | No fix yet |
| Red Hat Enterprise Linux 8 | Affected | No fix planned: Will not fix |
| Red Hat Enterprise Linux 9 | Affected | No fix planned: Will not fix |
| Red Hat OpenShift Container Platform 4 | Affected | No fix yet |
| Red Hat OpenShift Container Platform Assisted Installer 1 | Affected | No fix yet |
| Red Hat Quay 3 | Affected | No fix yet |
| RHACS 4.3 for RHEL 8 | Fixed | RHSA-2024:1321 |
| Red Hat OpenShift Container Platform 4.16 | Fixed | RHSA-2024:7944 |
| Red Hat OpenShift Container Platform 4.17 | Fixed | RHSA-2024:7922 |
Not affected: 5 products
- Multicluster Engine for Kubernetes
- Red Hat Advanced Cluster Management for Kubernetes 2
- Red Hat OpenShift Container Platform 4.16
- Red Hat OpenShift Container Platform 4.17
- Red Hat OpenStack Platform 16.2
Timeline
- 2026-10-02 Threatist record created from CVE-2024-27289
- 2026-10-03 Alias added: GHSA-m7wr-2xf7-cm9p
References
Advisory 3
More jackc Pgx vulnerabilities
- TI-2026-26188 CVE-2026-33816 in github.com/jackc/pgx CVSS 3.1CRITICAL 9.8
- TI-2026-26187 CVE-2026-33815 in github.com/jackc/pgx CVSS 3.1CRITICAL 9.8
- TI-2024-18142 pgx SQL Injection via Protocol Message Size Overflow CVSS 3.1CRITICAL 9.8
- TI-2026-30292 pgx: SQL Injection via placeholder confusion with dollar quoted string literals CVSS 4.0LOW 2.3
Sources
- CVE-2024-27289 · CVE Program
- CVE-2024-27289 · NVD
- FIRST EPSS
- GHSA-m7wr-2xf7-cm9p · GitHub Advisory Database · CC BY 4.0
- CVE-2024-27289 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences