CVE-2024-27289 json
pgx SQL Injection via Line Comment Creation
published 2024-03-04 2 y ago modified 2026-09-10 1 mo ago also GHSA-m7wr-2xf7-cm9p , GO-2024-2605 , EUVD-2024-0962
- cvss
- 8.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.8%
- EPSS 0.8% chance of exploitation in 30 days, percentile 58%
- public exploits
- 0
- none known
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.
Patch / fix
- go github.com/jackc/pgx 4.18.2
- go github.com/jackc/pgx/v4 4.18.2
- jackc pgx 4.18.2
- golang-github-jackc-pgx Debian 14, Debian 13 4.18.1-2
debian advisories DEBIAN-CVE-2024-27289
- telegraf Azure Linux 3.0 1.31.0-1
- telegraf CBL-Mariner 2.0 1.29.4-4
azure linux advisories AZL-35750AZL-35763
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
- github.com/jackc/pgx@f94eb0e commit
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-27289 updated cvss 8.1
pgx: SQL Injection via Line Comment Creation
-
Red Hat Multicluster Engine for Kubernetes multicluster-engine/agent-service-rhel8, multicluster-engine/assisted-installer-rhel8, multicluster-engine/assisted-installer-agent-rhel8affected: workaround, no fix available, no fix planned “A possible mitigation is to not use the simple protocol or do not place a minus directly before a placeholder.”
-
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 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-jsonaffected: workaround, no fix planned “A possible mitigation is to not use the simple protocol or do not place a minus directly before a placeholder.”
-
Red Hat Enterprise Linux 10 osbuild-composer Red Hat OpenShift Container Platform 4 openshift4/ose-agent-installer-api-server-rhel9, openshift4/ose-agent-installer-node-agent-rhel8 Red Hat OpenShift Container Platform Assisted Installer 1 rhai-tech-preview/assisted-installer-rhel8, rhai-tech-preview/assisted-installer-agent-rhel8 Red Hat Quay 3 quay/quay-rhel8, quay/clair-rhel8, quay/quay-operator-rhel8affected: workaround, no fix available “A possible mitigation is to not use the simple protocol or do not place a minus directly before a placeholder.”
-
Red Hat OpenShift Container Platform 4.16 openshift4/ose-agent-installer-csr-approver-rhel9 v4.16.0-202410031007.p0.g342902b.assembly.stream.el9fixed: vendor fix “A possible mitigation is to not use the simple protocol or do not place a minus directly before a placeholder.” RHSA-2024:7944
-
Red Hat OpenShift Container Platform 4.17 openshift4/ose-agent-installer-csr-approver-rhel9 v4.17.0-202410031034.p0.gfbc55c6.assembly.stream.el9fixed: vendor fix “A possible mitigation is to not use the simple protocol or do not place a minus directly before a placeholder.” RHSA-2024:7922
-
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 morefixed: vendor fix “A possible mitigation is to not use the simple protocol or do not place a minus directly before a placeholder.” RHSA-2024:1321
-
Red Hat Multicluster Engine for Kubernetes 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 Container Platform 4.16 rhcos 416.94.202410071428-0, openshift4/ose-cli-rhel9 v4.16.0-202410031007.p0.gcf533b5.assembly.stream.el9, openshift4/ose-sdn-rhel9 v4.16.0-202410071204.p0.gaec8163.assembly.stream.el9, openshift4/ose-tests-rhel9 v4.16.0-202410031007.p0.g06403d4.assembly.stream.el9, openshift4/ose-tools-rhel9 v4.16.0-202410031007.p0.gcf533b5.assembly.stream.el9, openshift4/ose-ironic-rhel9 v4.16.0-202410071406.p0.gf8a6955.assembly.stream.el9, +28 more Red Hat OpenShift Container Platform 4.17 rhcos 417.94.202410090854-0, openshift4/frr-rhel9 v4.17.0-202410071037.p0.g377d02f.assembly.stream.el9, openshift4/ose-cli-rhel9 v4.17.0-202410031034.p0.g9566b8e.assembly.stream.el9, openshift4/ose-pod-rhel9 v4.17.0-202410011205.p0.g9f67343.assembly.stream.el9, openshift4/ose-etcd-rhel9 v4.17.0-202410041306.p0.gc82057d.assembly.stream.el9, openshift4/ose-tests-rhel9 v4.17.0-202410090834.p0.g6513fc3.assembly.stream.el9, +182 more Red Hat OpenStack Platform 16.2 osp-director-provisioner-containernot 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
- Proof of concept is public
- Automatable
- no
- Technical impact
- total
- Assessed
- 2 y ago
Exploit prediction
0.85% chance of exploitation in the next 30 days, higher than 58% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:H/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 all versions |
4.18.2 |
| go | github.com/jackc/pgx/v4 | <4.18.2 |
4.18.2 |
Affected products
- jackc pgx
Classification
- Weakness
-
- CWE-89 Improper Neutralization of Special Elements used in an SQL Command
References
-
github.com
/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df
web, patch
-
github.com
/jackc/pgx/security/advisories/GHSA-m7wr-2xf7-cm9p
web, vendor-advisory, advisory
-
sonarsource.com
/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw/
third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2024-27289
advisory
-
github.com
/jackc/pgx
package
-
sonarsource.com
/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw
web
Sources
- CVE List CVE-2024-27289
- GitHub Advisory GHSA-m7wr-2xf7-cm9p
- NVD CVE-2024-27289
- OSV GO-2024-2605
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.