Skip to main content

PgBouncer CVE-2026-6665

| EUVDEUVD-2026-28877 CRITICAL
Stack-based Buffer Overflow (CWE-121)
2026-05-09 PostgreSQL GHSA-mhmx-mjv6-w337
9.8
CVSS 3.1 · NVD
Share

Severity by source

NVD PRIMARY
9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI
8.1 HIGH

AV:N but AC:H because the attacker must occupy the trusted backend position (compromise or MITM the pooler-to-server link) and win a stack overflow; impact kept high as crash-to-possible-RCE per SSVC total impact.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

7
Analysis Updated
Jul 24, 2026 - 08:29 vuln.today
v2 (cvss_changed)
Re-analysis Queued
Jul 24, 2026 - 08:22 vuln.today
cvss_changed
Severity Changed
Jul 24, 2026 - 08:22 NVD
HIGH CRITICAL
CVSS changed
Jul 24, 2026 - 08:22 NVD
8.1 (HIGH) 9.8 (CRITICAL)
Patch available
May 09, 2026 - 02:16 EUVD
Analysis Generated
May 09, 2026 - 01:31 vuln.today
CVE Published
May 09, 2026 - 00:43 nvd
HIGH 8.1

DescriptionNVD

The SCRAM code in PgBouncer before 1.25.2 did not check the return value of strlcat() correctly when building the contents of the SCRAM client-final-message. A malicious backend that sends a SCRAM server-final-message with a long nonce can trigger a stack overflow.

AnalysisAI

Stack-based buffer overflow in PgBouncer before 1.25.2 lets a malicious or impersonated PostgreSQL backend corrupt the pooler's memory during SCRAM authentication. Because the SCRAM code ignores the truncation return value of strlcat() while assembling the client-final-message, a backend that replies with an over-long SCRAM server-final-message nonce overruns a stack buffer, enabling a crash and potentially code execution in the PgBouncer process. There is no public exploit identified at time of analysis, it is not in CISA KEV, and EPSS is very low (0.02%), but SSVC rates the technical impact as total.

Technical ContextAI

PgBouncer is a lightweight connection pooler that sits between database clients and PostgreSQL backends. When PgBouncer authenticates to a backend using SCRAM-SHA-256 (the modern challenge-response mechanism in the PostgreSQL protocol), it must build a client-final-message that concatenates the combined client/server nonce with the client proof. The flaw is CWE-121 (stack-based buffer overflow): the code appends data into a fixed-size stack buffer with strlcat() but does not correctly check strlcat()'s return value, which reports the length that WOULD have been written rather than what fit. When the server-supplied nonce is unusually long, the concatenation logic proceeds as if it succeeded and writes past the end of the stack buffer. The affected component is the SCRAM client implementation inside PgBouncer itself (CPE cpe:2.3:a:n/a:pgbouncer), exercised on the pooler-to-backend authentication path rather than the client-to-pooler path.

RemediationAI

Vendor-released patch: PgBouncer 1.25.2 - upgrade all PgBouncer instances to 1.25.2 or later, per the changelog at https://www.pgbouncer.org/changelog.html#pgbouncer-125x. Until patched, reduce exposure by ensuring PgBouncer only connects to trusted, known-good PostgreSQL backends and by protecting the pooler-to-backend network path so a backend cannot be impersonated: require TLS with verify-full (server certificate verification) on the PgBouncer-to-PostgreSQL connection so a rogue server cannot substitute itself, and segment the database network so only the legitimate backend host can answer on the Postgres port. The trade-off of verify-full is stricter certificate management and possible connection failures if backend certificates are misconfigured; network segmentation offers no protection if the legitimate backend itself is compromised. These are compensating controls only - patching to 1.25.2 remains the sole complete fix.

CVE-2015-4054 HIGH POC
7.5 May 23

PgBouncer before 1.5.5 allows remote attackers to cause a denial of service (NULL pointer dereference and crash) by send

CVE-2021-3672 MEDIUM POC
5.6 Nov 23

A flaw was found in c-ares library, where a missing input validation check of host names returned by DNS (Domain Name Se

CVE-2015-6817 HIGH
8.1 May 23

PgBouncer 1.6.x before 1.6.1, when configured with auth_user, allows remote attackers to gain login access as auth_user

CVE-2025-2291 HIGH
8.1 Apr 16

Password can be used past expiry in PgBouncer due to auth_query not taking into account Postgres its VALID UNTIL value,

CVE-2021-3935 HIGH
8.1 Nov 22

When PgBouncer is configured to use "cert" authentication, a man-in-the-middle attacker can inject arbitrary SQL queries

CVE-2025-12819 HIGH
7.5 Dec 03

Untrusted search path in auth_query connection handler in PgBouncer before 1.25.1 allows an unauthenticated attacker to

CVE-2026-6664 HIGH
7.5 May 09

Remote denial-of-service in PgBouncer versions before 1.25.2 allows unauthenticated attackers to crash the connection po

CVE-2026-6666 HIGH
7.5 May 09

Denial of service in PgBouncer before 1.25.2 lets a malicious or malfunctioning PostgreSQL backend crash the connection

CVE-2012-4575 MEDIUM
5.0 Nov 18

The add_database function in objects.c in the pgbouncer pooler 1.5.2 for PostgreSQL allows remote attackers to cause a d

CVE-2026-6667 MEDIUM
4.3 May 09

PgBouncer before version 1.25.2 fails to properly restrict the KILL_CLIENT admin command to authorized users, allowing a

Share

CVE-2026-6665 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy