CVE-2024-27289
HIGH 8.1CVSS 3.1pgx SQL Injection via Line Comment Creation
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.
- Published
- 6 Mar 2024
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-89
- Also known as
- GHSA-m7wr-2xf7-cm9pGO-2024-2605
- Sources
- NVDJSONOSV GHSA-m7wr-2xf7-cm9pJSONOSV GO-2024-2605JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N | |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | jackc | pgxcpe:2.3:a:jackc:pgx:*:*:*:*:*:go:*:* |
< 4.18.2 | 4.18.2 |
| OSV | Go | github.com/jackc/pgx | < 4.18.2 | 4.18.2 |
| OSV | Go | github.com/jackc/pgx/v4 | < 4.18.2 | 4.18.2 |
| OSV | Go | github.com/jackc/pgx | all versions |
References
- https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df · Patch, WEB, FIX
- https://github.com/jackc/pgx/security/advisories/GHSA-m7wr-2xf7-cm9p · Vendor Advisory, WEB, ADVISORY
- https://www.sonarsource.com/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw/ · Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2024-27289 · ADVISORY
- https://github.com/jackc/pgx · PACKAGE
History
- 25 Nov 2026 20:55 UTC · NVD: first stored (published 6 Mar 2024)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 11 Mar 2024)
- 25 Nov 2026 20:13 UTC · OSV: first stored (published 4 Mar 2024)