# CVE-2024-27289: pgx SQL Injection via Line Comment Creation

- Severity: High 8.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.85%, higher than 59% of CVEs (2026-12-01)
- Published: 2024-03-04T20:13:11.000Z
- Modified: 2026-09-10T03:50:10.592Z
- Also known as: GHSA-m7wr-2xf7-cm9p, GO-2024-2605
- Related: CGA-6fr5-f876-7rfw
- Weaknesses: CWE-89
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- jackc pgx: < 4.18.2; before 4.18.2
- github.com/jackc/pgx (Go): before 4.18.2; all versions
- github.com/jackc/pgx/v4 (Go): before 4.18.2

## Every score

- GitHub_M: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:4.0 High `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`

## References

- <https://github.com/jackc/pgx/security/advisories/GHSA-m7wr-2xf7-cm9p> (advisory, vendor-advisory, web)
- <https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df> (fix, patch, web)
- <https://www.sonarsource.com/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw/> (third-party-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-27289> (advisory)
- <https://github.com/jackc/pgx> (package)
- <https://www.sonarsource.com/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw> (web)

## Sources

- CVE List: [CVE-2024-27289](https://www.cve.org/CVERecord?id=CVE-2024-27289), CVE Terms of Use, modified 2025-06-12
- GitHub Advisory Database: [GHSA-m7wr-2xf7-cm9p](https://github.com/advisories/GHSA-m7wr-2xf7-cm9p), CC-BY-4.0, modified 2026-09-10
- Go Vulnerability Database: [GO-2024-2605](https://pkg.go.dev/vuln/GO-2024-2605), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2024-27289](https://nvd.nist.gov/vuln/detail/CVE-2024-27289), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-27289 · Whole record: https://cve.day/CVE-2024-27289.json · Rebuilt by cve.day 2026-11-25T22:58:37.309Z
