CVE-2026-2005
PostgreSQL vulnerability analysis and mitigation

Overview

CVE-2026-2005 is a heap-based buffer overflow vulnerability in the PostgreSQL pgcrypto extension that allows an authenticated attacker acting as a ciphertext provider to execute arbitrary code as the operating system user running the database. It affects PostgreSQL versions 14.x before 14.21, 15.x before 15.16, 16.x before 16.12, 17.x before 17.8, and 18.x before 18.2. The vulnerability was published on February 12, 2026, and patches were released the same day. It carries a CVSS v3.1 base score of 8.8 (High) (PostgreSQL Advisory, Red Hat Bugzilla).

Technical details

The vulnerability is classified as CWE-122 (Heap-based Buffer Overflow) and CWE-120 (Buffer Copy without Checking Size of Input). The flaw resides in the pgcrypto extension's handling of ciphertext data: when decrypting attacker-controlled ciphertext, the extension fails to properly validate the size of the input before copying it into a heap-allocated buffer, resulting in a heap overflow. An authenticated attacker with low privileges who can supply crafted ciphertext to a pgcrypto decryption function can trigger the overflow and achieve arbitrary code execution as the OS user running the PostgreSQL process. The attack is network-accessible, requires no user interaction, and has low attack complexity. A patch commit is available in the PostgreSQL git repository (PostgreSQL Git, PostgreSQL Advisory).

Impact

Successful exploitation allows an authenticated low-privileged attacker to execute arbitrary code with the privileges of the database OS user (typically postgres), leading to complete compromise of the database server's confidentiality, integrity, and availability. An attacker could exfiltrate all data stored in the database, modify or destroy data, and potentially pivot to the underlying host or connected systems if the database user has elevated OS permissions. IBM products including API Connect, Business Automation Insights, and Instana Observability (OnPrem) that bundle PostgreSQL are also affected (Red Hat Bugzilla, IBM Advisory).

Exploitability

A public proof-of-concept exploit was published in May 2026 on GitHub (github.com/var77/CVE-2026-2005) and indexed by Sploitus, significantly lowering the barrier to exploitation (SecurityOnline, GBHackers). The vulnerability was notably discovered by AI-assisted security research (Wiz's ZeroDay Cloud event), which identified this as a ~20-year-old latent bug in pgcrypto (Wiz Blog, CSO Online). The EPSS score is approximately 0.055% (low probability of near-term exploitation), and there is no confirmed evidence of in-the-wild exploitation or CISA KEV listing as of the latest data. Exploitation requires valid database credentials with at least low privileges.

Exploitation steps

  1. Reconnaissance: Identify PostgreSQL instances running vulnerable versions (14.x < 14.21, 15.x < 15.16, 16.x < 16.12, 17.x < 17.8, 18.x < 18.2) with the pgcrypto extension enabled. Use network scanning tools or query pg_available_extensions if database access is already available.
  2. Obtain credentials: Acquire valid database credentials with at least low-privilege access (e.g., a regular database user). This may be achieved through credential stuffing, phishing, or exploitation of another vulnerability.
  3. Verify pgcrypto availability: Connect to the target database and confirm the extension is installed: SELECT * FROM pg_extension WHERE extname = 'pgcrypto';
  4. Craft malicious ciphertext: Prepare a specially crafted ciphertext payload that, when passed to a pgcrypto decryption function (e.g., pgp_sym_decrypt or decrypt), triggers the heap buffer overflow due to insufficient size validation.
  5. Trigger the overflow: Execute a SQL query invoking the vulnerable pgcrypto function with the malicious ciphertext, e.g., SELECT decrypt('\x<malicious_payload>'::bytea, 'key', 'aes');
  6. Achieve code execution: The heap overflow corrupts adjacent memory structures, enabling control of the instruction pointer and execution of attacker-supplied shellcode or ROP chain as the OS user running PostgreSQL (typically postgres) (SecurityOnline, Wiz Blog).

Indicators of compromise

  • Logs: PostgreSQL server logs (postgresql.log) showing crashes, segmentation faults, or unexpected process termination associated with pgcrypto function calls; repeated errors from decrypt, pgp_sym_decrypt, or related functions with unusual binary input.
  • Network: Unexpected outbound connections from the PostgreSQL server process to external IPs following invocation of pgcrypto functions; unusual database connections from new or low-privilege accounts invoking cryptographic functions.
  • Process: Unexpected child processes spawned by the PostgreSQL backend process (e.g., /bin/sh, bash, curl, wget, python); new files written to the PostgreSQL data directory or /tmp by the postgres OS user.
  • File System: New or modified files in the PostgreSQL installation or data directories owned by the postgres user; presence of web shells, reverse shell scripts, or unauthorized cron jobs added under the postgres account.
  • Database: Audit logs showing low-privilege users invoking pgcrypto decryption functions with large or malformed binary arguments; unexpected COPY TO/FROM PROGRAM commands or use of pg_read_file/pg_write_file after pgcrypto calls.

Mitigation and workarounds

Upgrade PostgreSQL to the patched versions: 18.2, 17.8, 16.12, 15.16, or 14.21 (PostgreSQL Release). Red Hat has issued multiple errata (RHSA-2026:3730, RHSA-2026:3887, RHSA-2026:3896, and others) for RHEL 8, 9, and 10 (Red Hat Bugzilla). Ubuntu (USN-8072-1), Debian (DLA-4524-1), SUSE, Amazon Linux, and other distributions have also released updates. As a workaround where immediate patching is not possible, disable the pgcrypto extension (DROP EXTENSION pgcrypto;) if it is not operationally required, restrict database network access to trusted hosts only, and enforce strong authentication controls. IBM product users should apply the vendor-specific fixes for API Connect, Business Automation Insights, and Instana Observability (IBM Advisory).

Community reactions

The vulnerability attracted significant attention due to its origin: it was discovered by AI-assisted security research at Wiz's ZeroDay Cloud event, with researchers noting the bug had existed in pgcrypto for approximately 20 years (Wiz Blog, CSO Online). Security blogger "thebuild.com" published a detailed retrospective titled "Two Decades, Two RCEs: What pgcrypto Has Been Doing Since 2005," highlighting the longevity of the flaw (TheBuild Blog). The release of a public PoC in May 2026 generated broad coverage across security news outlets including GBHackers, SecurityOnline, and CyberSecurityNews, with community discussion on Reddit (r/prtg) noting impact on PRTG and other third-party products. The Hacker News weekly recap also featured the vulnerability alongside other notable May 2026 disclosures.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

postgresql-15: 15.16-0+deb12u1

Fixed

sid

postgresql-18: 18.2-1

Fixed

trixie

postgresql-17: 17.8-0+deb13u1

Fixed

Ubuntu

Fixed

bionic (esm-infra)

postgresql-10

Unknown

devel

postgresql-18

Not Affected

focal (esm-infra)

postgresql-12

Unknown

jammy

postgresql-14: 14.22-0ubuntu0.22.04.1

Fixed

noble

postgresql-16: 16.13-0ubuntu0.24.04.1

Fixed

questing

postgresql-17: 17.9-0ubuntu0.25.10.1

Fixed

resolute

postgresql-18

Not Affected

trusty (esm-infra-legacy)

postgresql-9.3

Deferred

RHEL / CentOS

Fixed

RHEL 8

:appstream:postgresql:12:8100020260302082007:489197e6/pg_repack-0:12-8100020260302082007.489197e6.src

Fixed

RHEL 9

:appstream:postgresql-0:13.23-1.el9_0.1.src

Fixed

RHEL 10

postgresql16-0:16.13-1.el10_0.src

Fixed

Alpine

Fixed

edge

postgresql16: 16.12-r0

Fixed

v3.20

postgresql15: 15.16-r0, 16.12-r0

Fixed

v3.21

postgresql16: 16.12-r0, 17.8-r0

Fixed

v3.22

postgresql15: 15.16-r0

Fixed

v3.23

postgresql16: 16.12-r0

Fixed

SourceThis report was generated using AI

Related PostgreSQL vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-6464HIGH8.1
  • PostgreSQL logoPostgreSQL
  • postgresql16-upgrade-debuginfo
NoYesAug 13, 2026
CVE-2026-73515HIGH7.2
  • PostgreSQL logoPostgreSQL
  • postgresql:16::postgis
NoYesAug 13, 2026
CVE-2026-6471HIGH7.2
  • PostgreSQL logoPostgreSQL
  • postgresql18-server-devel-debuginfo
NoYesAug 13, 2026
CVE-2026-6470MEDIUM4.3
  • PostgreSQL logoPostgreSQL
  • postgresql17-pltcl-debuginfo
NoYesAug 13, 2026
CVE-2026-6469LOW3.8
  • PostgreSQL logoPostgreSQL
  • postgresql15-static
NoYesAug 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management