Cloudanix VulnDB

CVE-2024-27304

Critical · 9.8

CVSS

9.8

EPSS

1.1%

Published

Mar 6, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A flaw in a popular Go database tool lets attackers run unauthorized commands on your database by sending extremely large queries that the tool mishandles.

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

What it actually does

Integer overflow in pgx message size calculation allows a query or bind message exceeding 4 GB to be transmitted as multiple attacker-controlled messages, enabling SQL injection.

Why it matters to the business

Attackers can execute arbitrary database commands, risking data theft, corruption, or service disruption in applications using vulnerable pgx versions; widespread Go PostgreSQL driver usage amplifies exposure despite low EPSS and non-KEV status.

How an attack unfolds

An attacker supplies specially crafted input causing a single query or bind message to exceed 4 GB, triggering an integer overflow that splits the message; subsequent messages under attacker control inject malicious SQL statements into the PostgreSQL backend.

How to fix it

Upgrade pgx to v4.18.2 or v5.5.4; for Debian 12 systems apply package updates to version 6.1.106-1; implement input validation to reject queries or binds approaching 4 GB as a temporary workaround.

How to confirm the fix worked

Verify pgx version in go.mod or deployed binaries against fixed releases; attempt to send oversized queries in a test environment and confirm single-message handling without fragmentation; review database logs for unexpected multi-message sequences.

Typical attack path

  1. Locate web or application endpoints accepting user input passed to pgx queries or binds
  2. Craft and submit input sized to exceed 4 GB in a single query or bind message
  3. Exploit resulting integer overflow to fragment the message into multiple controlled packets
  4. Inject SQL payloads via the fragmented messages to execute unauthorized database operations

How to detect it

Inspect application and database logs for unusually large query or bind messages; correlate with PostgreSQL server logs showing fragmented multi-message sequences from the same session; review Go application error or debug logs for size-calculation anomalies.

What your security team should do

  • Immediately upgrade all pgx dependencies to v4.18.2 or v5.5.4 or apply Debian 6.1.106-1 patches
  • Add server-side input length checks rejecting payloads near 4 GB
  • Monitor EPSS trend and scan for any new exploit maturity indicators
  • Audit all Go applications for direct use of vulnerable pgx query/bind paths

The record

pgx is a PostgreSQL driver and toolkit for Go. SQL injection can occur if an attacker can cause a single query or bind message to exceed 4 GB in size. An integer overflow in the calculated message size can cause the one large message to be sent as multiple messages under the attacker's control. The problem is resolved in v4.18.2 and v5.5.4. As a workaround, reject user input large enough to cause a single query or bind message to exceed 4 GB in size.

Affected packages

Ecosystem Package Introduced Fixed
Go github.com/jackc/pgproto3 0 2.3.3
Go github.com/jackc/pgproto3/v2 0 2.3.3
Go github.com/jackc/pgx 0 No fix
Go github.com/jackc/pgx 0 4.18.2
Go github.com/jackc/pgx 5.0.0 5.5.4
Go github.com/jackc/pgx/v4 0 4.18.2
Go github.com/jackc/pgx/v5 5.0.0 5.5.4
Chainguard amass 0 4.2.0-r8
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 falcosidekick-fips 0 2.28.0-r3
Chainguard ferretdb 0 1.20.1-r3
Chainguard k3s 0 1.29.2-r3
Chainguard k3s-embedded 0 1.29.2-r3
Chainguard k3s-images 0 1.29.2-r3
Chainguard k3s-multicall 0 1.29.2-r3
Chainguard k3s-static 0 1.29.2-r3
Chainguard keda 0 2.13.1-r3
Chainguard keda-2.11 0 2.11.2-r16
Chainguard keda-2.11-adapter 0 2.11.2-r16
Chainguard keda-2.11-admission-webhooks 0 2.11.2-r16
Chainguard keda-2.11-compat 0 2.11.2-r16
Chainguard keda-2.12 0 2.12.1-r3
Chainguard keda-2.12-adapter 0 2.12.1-r3
Chainguard keda-2.12-admission-webhooks 0 2.12.1-r3
Chainguard keda-2.12-compat 0 2.12.1-r3
Chainguard keda-2.13 0 2.13.1-r2
Chainguard keda-2.13-adapter 0 2.13.1-r2
Chainguard keda-2.13-admission-webhooks 0 2.13.1-r2
Chainguard keda-2.13-compat 0 2.13.1-r2
Chainguard keda-adapter 0 2.13.1-r3
Chainguard keda-adapter-2.11 0 2.11.2-r16
Chainguard keda-adapter-fips 0 2.13.1-r4
Chainguard keda-admission-webhooks 0 2.13.1-r3
Chainguard keda-admission-webhooks-2.11 0 2.11.2-r16
Chainguard keda-admission-webhooks-fips 0 2.13.1-r4
Chainguard keda-compat 0 2.13.1-r3
Chainguard keda-compat-2.11 0 2.11.2-r16
Chainguard keda-fips 0 2.13.1-r4
Chainguard keda-metrics-apiserver-fips 0 2.13.1-r4
Chainguard kine 0 0.11.6-r2
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 kube-bench 0 0.7.2-r3
Chainguard kube-bench-configs 0 0.7.2-r3
Chainguard kube-bench-configs-fips 0 0.7.2-r1
Chainguard kube-bench-fips 0 0.7.2-r1
Chainguard spicedb 0 1.30.0-r0
Chainguard spicedb-compat 0 1.30.0-r0
Chainguard src 0 5.3.0-r2
Chainguard step 0 0.28.6-r0
Chainguard step-ca 0 0.25.2-r5
Chainguard tdbg 0 1.23.0-r1
Chainguard tdbg-compact 0 1.23.0-r1
Chainguard tdbg-compat 0 1.23.0-r1
Chainguard tdbg-fips 0 1.23.0-r1
Chainguard tdbg-fips-compat 0 1.23.0-r1
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 temporal-cassandra-tool 0 1.23.0-r1
Chainguard temporal-cassandra-tool-compat 0 1.23.0-r1
Chainguard temporal-cassandra-tool-fips 0 1.23.0-r1
Chainguard temporal-cassandra-tool-fips-compat 0 1.23.0-r1
Chainguard temporal-server 0 1.23.0-r1
Chainguard temporal-server-compat 0 1.23.0-r1
Chainguard temporal-server-fips 0 1.23.0-r1
Chainguard temporal-server-fips-compat 0 1.23.0-r1
Chainguard temporal-server-oci-entrypoint 0 1.23.0-r1
Chainguard temporal-server-oci-entrypoint-fips 0 1.23.0-r1
Chainguard temporal-server-schema 0 1.23.0-r1
Chainguard temporal-server-schema-fips 0 1.23.0-r1
Chainguard temporal-sql-tool 0 1.23.0-r1
Chainguard temporal-sql-tool-compact 0 1.23.0-r1
Chainguard temporal-sql-tool-compat 0 1.23.0-r1
Chainguard temporal-sql-tool-fips 0 1.23.0-r1
Chainguard temporal-sql-tool-fips-compat 0 1.23.0-r1
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-pgproto3 0 No fix
Ubuntu:24.04:LTS golang-github-jackc-pgx 0 No fix
Ubuntu:24.10 golang-github-jackc-pgproto3 0 No fix
Ubuntu:24.10 golang-github-jackc-pgx 0 No fix
Ubuntu:25.04 golang-github-jackc-pgproto3 0 No fix
Ubuntu:25.04 golang-github-jackc-pgx 0 No fix
Ubuntu:25.10 golang-github-jackc-pgproto3 0 No fix
Ubuntu:25.10 golang-github-jackc-pgx 0 No fix
Wolfi amass 0 4.2.0-r8
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 ferretdb 0 1.20.1-r3
Wolfi k3s 0 1.29.2-r3
Wolfi k3s-embedded 0 1.29.2-r3
Wolfi k3s-images 0 1.29.2-r3
Wolfi k3s-multicall 0 1.29.2-r3
Wolfi k3s-static 0 1.29.2-r3
Wolfi keda 0 2.13.1-r3
Wolfi keda-2.11 0 2.11.2-r16
Wolfi keda-2.11-adapter 0 2.11.2-r16
Wolfi keda-2.11-admission-webhooks 0 2.11.2-r16
Wolfi keda-2.11-compat 0 2.11.2-r16
Wolfi keda-2.12 0 2.12.1-r3
Wolfi keda-2.12-adapter 0 2.12.1-r3
Wolfi keda-2.12-admission-webhooks 0 2.12.1-r3
Wolfi keda-2.12-compat 0 2.12.1-r3
Wolfi keda-2.13 0 2.13.1-r2
Wolfi keda-2.13-adapter 0 2.13.1-r2
Wolfi keda-2.13-admission-webhooks 0 2.13.1-r2
Wolfi keda-2.13-compat 0 2.13.1-r2
Wolfi keda-adapter 0 2.13.1-r3
Wolfi keda-adapter-2.11 0 2.11.2-r16
Wolfi keda-admission-webhooks 0 2.13.1-r3
Wolfi keda-admission-webhooks-2.11 0 2.11.2-r16
Wolfi keda-compat 0 2.13.1-r3
Wolfi keda-compat-2.11 0 2.11.2-r16
Wolfi kine 0 0.11.6-r2
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 kube-bench 0 0.7.2-r3
Wolfi kube-bench-configs 0 0.7.2-r3
Wolfi spicedb 0 1.30.0-r0
Wolfi spicedb-compat 0 1.30.0-r0
Wolfi src 0 5.3.0-r2
Wolfi step 0 0.28.6-r0
Wolfi step-ca 0 0.25.2-r5
Wolfi tdbg 0 1.23.0-r1
Wolfi tdbg-compact 0 1.23.0-r1
Wolfi tdbg-compat 0 1.23.0-r1
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 temporal-cassandra-tool 0 1.23.0-r1
Wolfi temporal-cassandra-tool-compat 0 1.23.0-r1
Wolfi temporal-server 0 1.23.0-r1
Wolfi temporal-server-compat 0 1.23.0-r1
Wolfi temporal-server-oci-entrypoint 0 1.23.0-r1
Wolfi temporal-server-schema 0 1.23.0-r1
Wolfi temporal-sql-tool 0 1.23.0-r1
Wolfi temporal-sql-tool-compact 0 1.23.0-r1
Wolfi temporal-sql-tool-compat 0 1.23.0-r1
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
go github.com/jackc/pgx 5.0.0 5.5.4
go github.com/jackc/pgx/v5 5.0.0 5.5.4

Related vulnerabilities