CVE-2024-27289
highpriority · track · 0EPSS 0.008 · 58 %ileDEEURUUSEPSS · scored 2026-10-23
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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (11)
Products and version ranges known to be affected.
advisories (3)
Vendor and ecosystem advisories describing this.
- WID-SEC-W-2024-0626Red Hat Enterprise Linux: Mehrere Schwachstellen ermöglichen Manipulation von DateienDeutsch2024-03-13csaf · cert_bundDE
Ein entfernter, anonymer Angreifer kann mehrere Schwachstellen in Red Hat Enterprise Linux ausnutzen, um Dateien zu manipulieren.
- GHSA-m7wr-2xf7-cm9ppgx SQL Injection via Line Comment Creation2024-03-04ghsa · osvUS
### Impact SQL injection can occur when all of the following conditions are met: 1. The non-default simple protocol is used. 2. A placeholder for a numeric value must be immediately preceded by a minus. 3. There must be a second placeholder for a string value after the first placeholder; both must be on the same line. 4. Both parameter values must be user-controlled. e.g. Simple mode must be enabled: ```go // connection string includes "prefer_simple_protocol=true" // or // directly enabled in code config.ConnConfig.PreferSimpleProtocol = true ``` Parameterized query: ```sql SELECT * FROM example WHERE result=-$1 OR name=$2; ``` Parameter values: `$1` => `-42` `$2` => `"foo\n 1 AND 1=0 UNION SELECT * FROM secrets; --"` Resulting query after preparation: ```sql SELECT * FROM example WHERE result=--42 OR name= 'foo 1 AND 1=0 UNION SELECT * FROM secrets; --'; ``` ### Patches The problem is resolved in v4.18.2. ### Workarounds Do not use the simple protocol or do not place a minus directly before a placeholder.
- GO-2024-2605SQL injection in github.com/jackc/pgx/v42024-03-11vendor · osvUS
SQL injection is possible when the database uses the non-default simple protocol, a minus sign directly precedes a numeric placeholder followed by a string placeholder on the same line, and both parameter values are user-controlled.
also known as (6)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (11)
External citations — patches, advisories, analysis.
- https://access.redhat.com/security/cve/cve-2024-27289cnnvd
- https://cxsecurity.com/cveshow/CVE-2024-27289/cnnvd
- https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81dfcnnvd
- https://github.com/jackc/pgx/releases/tag/v4.18.2Patchcnnvd
- https://github.com/jackc/pgx/security/advisories/GHSA-m7wr-2xf7-cm9pcnnvd
- https://www.sonarsource.com/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw/cnnvd
- https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81dfenisa_euvd
- https://github.com/jackc/pgx/security/advisories/GHSA-m7wr-2xf7-cm9penisa_euvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan