golang-github-jackc-pgx — security advisory
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.
- Products
- golang-github-jackc-pgx
- Affected versions
- 3.6.2-2, 4.15.0-4, 4.18.1-1, 4.18.1-2, 4.18.3-2
- Fixed versions
- Not specified
- CVEs
- CVE-2024-27289
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 01:12 UTC · Revision 1
Source evidence
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.
osv:UBUNTU-CVE-2024-27289
golang-github-jackc-pgx
Fixed versions: Not specified
golang-github-jackc-pgx
Fixed versions: Not specified
golang-github-jackc-pgx
Fixed versions: Not specified
golang-github-jackc-pgx
Fixed versions: Not specified
golang-github-jackc-pgx
Fixed versions: Not specified
Complete source record
{
"id": "c2003da070cafe6c3087b29a257a6baf03d645f63ad686403d16638515322e0e",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2024-27289",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-CVE-2024-27289",
"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.",
"evidence": "osv:UBUNTU-CVE-2024-27289",
"products": [
{
"name": {
"value": "golang-github-jackc-pgx",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.6.2-2",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "golang-github-jackc-pgx",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "4.15.0-4",
"evidence": "/affected/1/versions"
},
{
"value": "4.18.1-1",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "golang-github-jackc-pgx",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "4.18.1-1",
"evidence": "/affected/2/versions"
},
{
"value": "4.18.1-2",
"evidence": "/affected/2/versions"
}
]
},
{
"name": {
"value": "golang-github-jackc-pgx",
"evidence": "/affected/3/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "4.18.1-2",
"evidence": "/affected/3/versions"
},
{
"value": "4.18.3-2",
"evidence": "/affected/3/versions"
}
]
},
{
"name": {
"value": "golang-github-jackc-pgx",
"evidence": "/affected/4/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "4.18.1-2",
"evidence": "/affected/4/versions"
}
]
}
],
"severity": "high",
"structured": {
"id": "UBUNTU-CVE-2024-27289",
"aliases": [
"UBUNTU-CVE-2024-27289"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
},
{
"type": "Ubuntu",
"score": "medium"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "golang-github-jackc-pgx",
"purl": "pkg:deb/ubuntu/golang-github-jackc-pgx?arch=source&distro=jammy",
"ecosystem": "Ubuntu:22.04:LTS"
},
"versions": [
"3.6.2-2"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-27289.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "golang-github-jackc-pgx-dev",
"binary_version": "3.6.2-2"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "golang-github-jackc-pgx",
"purl": "pkg:deb/ubuntu/golang-github-jackc-pgx?arch=source&distro=noble",
"ecosystem": "Ubuntu:24.04:LTS"
},
"versions": [
"4.15.0-4",
"4.18.1-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-27289.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "golang-github-jackc-pgx-v4-dev",
"binary_version": "4.18.1-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "golang-github-jackc-pgx",
"purl": "pkg:deb/ubuntu/golang-github-jackc-pgx?arch=source&distro=questing",
"ecosystem": "Ubuntu:25.10"
},
"versions": [
"4.18.1-1",
"4.18.1-2"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-27289.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "golang-github-jackc-pgx-v4-dev",
"binary_version": "4.18.1-2"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "golang-github-jackc-pgx",
"purl": "pkg:deb/ubuntu/golang-github-jackc-pgx?arch=source&distro=stonking",
"ecosystem": "Ubuntu:26.10"
},
"versions": [
"4.18.1-2",
"4.18.3-2"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-27289.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "golang-github-jackc-pgx-v4-dev",
"binary_version": "4.18.3-2"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "golang-github-jackc-pgx",
"purl": "pkg:deb/ubuntu/golang-github-jackc-pgx?arch=source&distro=resolute",
"ecosystem": "Ubuntu:26.04:LTS"
},
"versions": [
"4.18.1-2"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-27289.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "golang-github-jackc-pgx-v4-dev",
"binary_version": "4.18.1-2"
}
]
}
}
],
"modified": "2026-10-17T12:56:43.512932421Z",
"provider": "osv",
"upstream": [
"CVE-2024-27289"
],
"references": [
"https://ubuntu.com/security/CVE-2024-27289",
"https://github.com/jackc/pgx/security/advisories/GHSA-m7wr-2xf7-cm9p",
"https://github.com/jackc/pgx/commit/826a89229b8b1cdf18e4190afa437d3df9901b9c",
"https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df",
"https://www.cve.org/CVERecord?id=CVE-2024-27289"
]
},
"related_cves": [
{
"value": "CVE-2024-27289",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 356057,
"published_at": "2024-03-06T19:15:00+00:00"
}