Skip to main content

PgBouncer EUVDEUVD-2026-28877

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

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Compromise or impersonate PostgreSQL backend
  2. Delivery
    PgBouncer initiates SCRAM authentication
  3. Exploit
    Backend returns long-nonce server-final-message
  4. Execution
    strlcat overflows client-final-message stack buffer
  5. Impact
    Crash 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.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – 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)
v1 May 09, 2026 - 01:31 CVSS 8.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

PgBouncer 0 <1.25.2

Affected Packages

euvd pgbouncer fix: 1.25.2

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

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

5
Analysis Updated
Jul 24, 2026 - 08:29 vuln.today
v2 - 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
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.

Executive ViewAI

Why It Matters

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.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.0%
Top 96% exploitable
Prevalence
High
de facto standard connection pooler in PostgreSQL production deployments
Social Media
2
Sightings
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

49
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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 4
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-2026-107350 HIGH
8.8 Oct 14

Authentication bypass in PgBouncer 1.17.0 through 1.26.0 allows an authenticated attacker who knows a valid password for

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-2025-12819 HIGH
8.1 Dec 03

Arbitrary SQL execution during authentication affects PgBouncer before 1.25.1 when the non-default auth_query feature is

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-2026-107349 HIGH
7.5 Oct 14

Unauthenticated remote attackers can render PgBouncer 1.20.0 through 1.26.0 unresponsive by sending a single crafted Sta

CVE-2026-6668 HIGH
7.5 Sep 23

A crafted oversized input to the PgBouncer connection pooler (versions through 1.25.2) triggers an integer overflow in p

CVE-2026-19888 HIGH
7.5 Sep 23

Unauthenticated remote attackers can crash PgBouncer through 1.25.2 by sending a malformed SCRAM client-final-message th

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