CVE-2026-6665

PgBouncer buffer overflow in SCRAM

Published May 9, 2026 CVSS 3.1 · 8.1 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

PgBouncer versions prior to 1.25.2 contain a buffer overflow in the SCRAM client-final-message construction. The flaw arises when the return value of strlcat() is incorrectly interpreted, allowing a backend that issues a very long SCRAM server‑final‑message to overflow the stack. An attacker who can supply such a message can potentially overwrite critical stack data, leading to arbitrary code execution or a denial‑of‑service event on the PgBouncer instance. The weakness is a classic stack buffer overflow (CWE‑121).

Affected Systems

The vulnerability affects PgBouncer prior to version 1.25.2. Any deployment using PgBouncer 1.25.1 or earlier that employs SCRAM authentication with a PostgreSQL backend is potentially exposed. The issue is resolved in PgBouncer 1.25.2 and later releases.

Risk and Exploitability

With a CVSS score of 8.1 the vulnerability is considered high severity. No EPSS data is available and the flaw is not listed in CISA's KEV catalog. Exploitation requires the attacker to have control over or influence the PostgreSQL backend to send a crafted SCRAM server‑final‑message; thus it is most relevant in environments where PgBouncer connects to a backend that may be compromised or mal‑configured. If that precondition is met, the flaw can lead to arbitrary code execution on the PgBouncer host.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade PgBouncer to version 1.25.2 or newer.
  • If an upgrade is not immediately possible, prevent PgBouncer from communicating with untrusted backends by restricting network access or disabling SCRAM authentication on those connections.
  • Monitor PgBouncer logs for abnormal termination or stack‑overflow warnings and enforce strict firewall rules to isolate the PgBouncer process.

Generated by OpenCVE AI on May 9, 2026 at 03:16 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:pgbouncer:pgbouncer:*:*:*:*:*:*:*:*
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Pgbouncer
Pgbouncer pgbouncer
Vendors & Products Pgbouncer
Pgbouncer pgbouncer
Type Values Removed Values Added
Description 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.
Title PgBouncer buffer overflow in SCRAM
Weaknesses CWE-121
References
Metrics cvssV3_1

{'score': 8.1, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H'}

Weaknesses
  • CWE-121

    Stack-based Buffer Overflow

Sources

Status
PUBLISHED
Assigner
PostgreSQL
Published
Updated
May 12, 2026, 3:55 AM
Reserved
Apr 20, 2026, 12:25 PM
Status
Analyzed
Published
May 9, 2026, 1:16 AM
Modified
Jul 24, 2026, 8:10 AM