Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCompromise or impersonate PostgreSQL backend
-
DeliveryPgBouncer initiates SCRAM authentication
-
ExploitBackend returns long-nonce server-final-message
-
Executionstrlcat overflows client-final-message stack buffer
-
ImpactCrash pooler or execute code
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Stack buffer bounds checking
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires the attacker to act as the PostgreSQL backend that PgBouncer authenticates to: either a compromised/rogue backend server or an active man-in-the-middle on the PgBouncer-to-PostgreSQL connection. PgBouncer must be using SCRAM-SHA-256 authentication toward that backend and must be running a version before 1.25.2. The concrete trigger is a SCRAM server-final-message carrying an over-long nonce. Limiting factors that reduce real-world risk: the malicious input originates from the backend (normally a trusted component), so this is not exploitable by ordinary database clients connecting through the pooler; exploitation is blocked if the pooler-to-backend link uses TLS with certificate verification and the backend host is trusted and uncompromised; SSVC marks exploitation as none and not automatable. |
| Impact | The signals conflict sharply and should temper the headline CVSS of 9.8. The published vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H implies trivial unauthenticated remote exploitation, but the description makes clear the trigger comes from a MALICIOUS BACKEND sending a crafted server-final-message - i.e. the attacker must control, compromise, or man-in-the-middle the PostgreSQL server that PgBouncer connects to, which is normally a trusted component. That precondition is not captured by the base score and should be verified against the vendor changelog. Corroborating lower real-world urgency: EPSS is 0.02% (4th percentile), and CISA's SSVC framework marks Exploitation as none and Automatable as no, while agreeing Technical Impact is total. There is no KEV listing and no public exploit identified at time of analysis. Net assessment: a genuine memory-safety defect with high theoretical impact (crash, possible RCE in the pooler) but a constrained, non-default threat model - realistic priority is moderate, dominated by scenarios where the backend or the pooler-to-backend link is untrusted, not by opportunistic internet-wide attack. |
| Exploit ScenarioDerived | An attacker who controls a PostgreSQL backend - a compromised database host, a rogue server inserted via DNS/ARP spoofing, or a man-in-the-middle on an unencrypted pooler-to-backend link - waits for PgBouncer to open a pooled connection and begin SCRAM authentication. During the handshake the malicious backend returns a server-final-message containing an abnormally long nonce, overflowing PgBouncer's stack buffer to crash the pooler (denial of service) or potentially execute code in its process. No public proof-of-concept exists at time of analysis, and the need to occupy the backend position plus stack-overflow reliability make code execution non-trivial. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Jul 24, 2026
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.
Earlier versions of this analysis (1)
Stack overflow in PgBouncer before 1.25.2 enables malicious PostgreSQL backend servers to trigger remote code execution via SCRAM authentication nonce manipulation. The flaw stems from incorrect strlcat() return value checking during SCRAM client-final-message construction. Remote unauthenticated exploitation is possible (CVSS 8.1, AV:N/PR:N) but requires high attack complexity - specifically, the attacker must control or compromise the backend PostgreSQL server PgBouncer connects to. No public exploit identified at time of analysis; EPSS and KEV data not available in this assessment.
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.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
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.
Know when Pgbouncer gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
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.
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
5DescriptionNVD
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.
Executive ViewAI
PgBouncer connection pooler instances contain a critical stack buffer overflow in SCRAM authentication that risks database service disruption or potential unauthorized backend access. While no public exploit has been identified and exploitation likelihood remains minimal, the CRITICAL vulnerability rating demands rapid remediation to protect database availability across your infrastructure.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
A stack-based buffer overflow occurs when a program writes more data to a buffer located on the stack than it was allocated to hold.
Related Vulnerabilities in PgBouncer Multiple Security Issues
View all 4PgBouncer before 1.5.5 allows remote attackers to cause a denial of service (NULL pointer dereference and crash) by send
A flaw was found in c-ares library, where a missing input validation check of host names returned by DNS (Domain Name Se
Authentication bypass in PgBouncer 1.17.0 through 1.26.0 allows an authenticated attacker who knows a valid password for
PgBouncer 1.6.x before 1.6.1, when configured with auth_user, allows remote attackers to gain login access as auth_user
Password can be used past expiry in PgBouncer due to auth_query not taking into account Postgres its VALID UNTIL value,
Arbitrary SQL execution during authentication affects PgBouncer before 1.25.1 when the non-default auth_query feature is
When PgBouncer is configured to use "cert" authentication, a man-in-the-middle attacker can inject arbitrary SQL queries
Unauthenticated remote attackers can render PgBouncer 1.20.0 through 1.26.0 unresponsive by sending a single crafted Sta
A crafted oversized input to the PgBouncer connection pooler (versions through 1.25.2) triggers an integer overflow in p
Unauthenticated remote attackers can crash PgBouncer through 1.25.2 by sending a malformed SCRAM client-final-message th
EUVD-2026-28877
GHSA-mhmx-mjv6-w337
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB