Cloudanix VulnDB

CVE-2024-27289

High · 8.1

CVSS

8.1

EPSS

0.8%

Published

Mar 6, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A flaw in a database connection tool could let attackers steal or change information stored in a database when specific coding patterns are present.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
High
Impact
Full Compromise
Component
Library
Class
SQL Injection
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

SQL injection in pgx Go driver occurs when simple protocol is enabled and a numeric placeholder is immediately preceded by a minus sign on the same line as a following string placeholder, allowing user-controlled values to alter the executed query structure.

Why it matters to the business

Attackers could read, modify, or delete sensitive database records, potentially causing data breaches, service disruption, or regulatory penalties; the issue affects applications on Debian systems until patched packages are deployed.

How an attack unfolds

An attacker supplies crafted input that places a minus directly before a numeric placeholder followed by a string placeholder on the same line while the application uses the non-default simple protocol, causing the driver to concatenate values into the query and execute attacker-controlled SQL commands.

How to fix it

Upgrade pgx to version 4.18.2 or later; on Debian 12 update to package version 6.1.106-1. As a workaround avoid the simple protocol or ensure no minus sign appears directly before a placeholder.

How to confirm the fix worked

Inspect go.mod or vendor files for pgx version 4.18.2+, confirm Debian packages are at 6.1.106-1, and test application queries with crafted minus-prefixed numeric placeholders under the simple protocol to verify injection is blocked.

Typical attack path

  1. Locate an application using pgx with the simple protocol enabled
  2. Identify query patterns containing a minus immediately before a numeric placeholder followed by a string placeholder on the same line
  3. Submit user-controlled values that break out of the intended query structure
  4. Execute arbitrary SQL to read, modify, or delete data

How to detect it

Review database query logs and application request logs for SQL statements containing unexpected commands or syntax after numeric placeholders that were preceded by a minus sign; correlate with application code paths using the simple protocol.

What your security team should do

  • Immediately upgrade pgx to 4.18.2 and apply Debian 6.1.106-1 updates across all environments
  • Audit code for simple-protocol usage and refactor to the extended protocol where possible
  • Add input sanitization and query parameterization reviews to prevent similar placeholder misuse
  • Monitor EPSS and exploit maturity indicators for any future increase in observed attacks

The record

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.

Affected packages

Ecosystem Package Introduced Fixed
Go github.com/jackc/pgx 0 No fix
Go github.com/jackc/pgx 0 4.18.2
Go github.com/jackc/pgx/v4 0 4.18.2
Chainguard argo-workflow-cli 0 3.5.5-r3
Chainguard argo-workflow-cli-fips 0 3.5.5-r2
Chainguard argo-workflow-controller 0 3.5.5-r3
Chainguard argo-workflow-controller-compat 0 3.5.5-r3
Chainguard argo-workflow-controller-compat-fips 0 3.5.5-r2
Chainguard argo-workflow-controller-fips 0 3.5.5-r2
Chainguard argo-workflow-executor 0 3.5.5-r3
Chainguard argo-workflow-executor-compat 0 3.5.5-r3
Chainguard argo-workflow-executor-compat-fips 0 3.5.5-r2
Chainguard argo-workflow-executor-fips 0 3.5.5-r2
Chainguard argo-workflows 0 3.5.5-r3
Chainguard argo-workflows-fips 0 3.5.5-r2
Chainguard argo-workflows-known-hosts 0 3.5.5-r3
Chainguard argo-workflows-known-hosts-fips 0 3.5.5-r2
Chainguard argo-workflows-ui 0 3.5.5-r3
Chainguard caddy 0 2.7.6-r4
Chainguard caddy-fips 0 2.7.6-r1
Chainguard caddy-man 0 2.7.6-r1
Chainguard caddy-man 0 2.7.6-r4
Chainguard caddy-src 0 2.7.6-r4
Chainguard kots 0 1.108.1-r0
Chainguard kots-compat 0 1.108.1-r0
Chainguard kots-symlink-compat 0 1.108.1-r0
Chainguard step 0 0.28.6-r0
Chainguard step-ca 0 0.25.2-r5
Chainguard telegraf-1.26 0 1.26.3-r14
Chainguard telegraf-1.27 0 1.27.4-r16
Chainguard telegraf-1.28 0 1.28.5-r8
Chainguard telegraf-1.29 0 1.29.5-r4
Chainguard telegraf-1.30 0 1.30.0-r2
Chainguard trillian 0 1.6.0-r2
Chainguard trillian-fips 0 1.6.0-r2
Chainguard trillian-fips-logserver 0 1.6.0-r2
Chainguard trillian-fips-logsigner 0 1.6.0-r2
Chainguard trillian-logserver 0 1.6.0-r2
Chainguard trillian-logsigner 0 1.6.0-r2
Chainguard vault-1.13 0 1.13.13-r2
Chainguard vault-1.13-compat 0 1.13.13-r2
Chainguard vault-1.13-entrypoint 0 1.13.13-r2
Chainguard vault-fips-1.14 0 1.14.10-r0
Chainguard wavefront-collector-for-kubernetes-1.12 0 1.12.1-r9
Chainguard wavefront-collector-for-kubernetes-1.13 0 1.13.0-r9
Debian:11 golang-github-jackc-pgx 0 No fix
Debian:12 golang-github-jackc-pgx 0 No fix
Debian:13 golang-github-jackc-pgx 0 No fix
Ubuntu:22.04:LTS golang-github-jackc-pgx 0 No fix
Ubuntu:24.04:LTS golang-github-jackc-pgx 0 No fix
Ubuntu:24.10 golang-github-jackc-pgx 0 No fix
Ubuntu:25.04 golang-github-jackc-pgx 0 No fix
Ubuntu:25.10 golang-github-jackc-pgx 0 No fix
Wolfi argo-workflow-cli 0 3.5.5-r3
Wolfi argo-workflow-controller 0 3.5.5-r3
Wolfi argo-workflow-controller-compat 0 3.5.5-r3
Wolfi argo-workflow-executor 0 3.5.5-r3
Wolfi argo-workflow-executor-compat 0 3.5.5-r3
Wolfi argo-workflows 0 3.5.5-r3
Wolfi argo-workflows-known-hosts 0 3.5.5-r3
Wolfi argo-workflows-ui 0 3.5.5-r3
Wolfi caddy 0 2.7.6-r4
Wolfi caddy-man 0 2.7.6-r4
Wolfi caddy-src 0 2.7.6-r4
Wolfi kots 0 1.108.1-r0
Wolfi kots-compat 0 1.108.1-r0
Wolfi kots-symlink-compat 0 1.108.1-r0
Wolfi step 0 0.28.6-r0
Wolfi step-ca 0 0.25.2-r5
Wolfi telegraf-1.26 0 1.26.3-r14
Wolfi telegraf-1.27 0 1.27.4-r16
Wolfi telegraf-1.28 0 1.28.5-r8
Wolfi telegraf-1.29 0 1.29.5-r4
Wolfi telegraf-1.30 0 1.30.0-r2
Wolfi trillian 0 1.6.0-r2
Wolfi trillian-logserver 0 1.6.0-r2
Wolfi trillian-logsigner 0 1.6.0-r2
Wolfi vault-1.13 0 1.13.13-r2
Wolfi vault-1.13-compat 0 1.13.13-r2
Wolfi vault-1.13-entrypoint 0 1.13.13-r2

Related vulnerabilities