CVE-2026-2007
PostgreSQL vulnerability analysis and mitigation

Overview

CVE-2026-2007 is a heap-based buffer overflow vulnerability in the PostgreSQL pg_trgm extension that allows a database user to trigger out-of-bounds memory writes via a crafted input string. The vulnerability affects PostgreSQL versions 18.0 and 18.1; version 18.2 and later are not affected. It was disclosed on February 12, 2026, and carries a CVSS v3.1 base score of 8.2 (High) (Red Hat Bugzilla, PostgreSQL Advisory).

Technical details

The root cause is a heap-based buffer overflow (CWE-122) combined with a classic buffer copy without size checking (CWE-120) in the pg_trgm extension's input string processing logic. An authenticated database user can submit a specially crafted string to the pg_trgm functions, causing the server to write beyond the bounds of an allocated heap buffer. While the attacker has limited control over the specific byte patterns written, the PostgreSQL project has not ruled out privilege escalation as a potential outcome. A fix commit is available in the PostgreSQL git repository (PostgreSQL Git, Red Hat Bugzilla).

Impact

Successful exploitation can result in denial of service through application crashes, potential data integrity corruption due to uncontrolled heap memory writes, and — though not confirmed — possible privilege escalation within the database server. The impact is limited to systems running PostgreSQL 18.0 or 18.1 with the pg_trgm extension loaded, and exploitation requires at minimum a valid database user account. Confidentiality impact is assessed as none, while integrity and availability impacts are rated low and high, respectively (Red Hat Bugzilla, PostgreSQL Advisory).

Exploitability

No public proof-of-concept exploit code is known to exist, and there is no evidence of in-the-wild exploitation at this time. The EPSS score is approximately 0.04%, reflecting a low near-term exploitation probability. The vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires an authenticated database user account, which somewhat limits the attack surface (Red Hat Bugzilla).

Exploitation steps

  1. Gain database access: Obtain credentials for any database user account on a PostgreSQL 18.0 or 18.1 instance with the pg_trgm extension enabled (e.g., via credential theft, brute force, or a low-privilege account).
  2. Verify extension presence: Execute SELECT * FROM pg_extension WHERE extname = 'pg_trgm'; to confirm the extension is installed.
  3. Craft malicious input: Construct a specially crafted input string designed to trigger the heap buffer overflow in pg_trgm processing functions such as similarity(), show_trgm(), or related operators.
  4. Submit the payload: Execute a query using the crafted string, e.g., SELECT similarity('crafted_payload', 'test');, causing the server to write beyond the allocated heap buffer.
  5. Achieve impact: Depending on heap layout and memory state, the result may be a server crash (denial of service) or, in a best-case scenario for the attacker, memory corruption that could be leveraged for privilege escalation (Red Hat Bugzilla, PostgreSQL Advisory).

Indicators of compromise

  • Logs: PostgreSQL server logs showing unexpected crashes or FATAL/PANIC messages originating from pg_trgm-related functions; repeated errors referencing memory access violations or segmentation faults in postgresql.log.
  • Process: Unexpected PostgreSQL backend process terminations (postmaster restarting child processes) correlated with queries involving pg_trgm functions such as similarity(), show_trgm(), or the % operator.
  • Database Activity: Audit logs showing a database user submitting unusually long or malformed strings to pg_trgm functions; queries with abnormally large input strings to similarity or trigram operators from unexpected users or application accounts.

Mitigation and workarounds

Upgrade PostgreSQL to version 18.2 or later, which contains the fix for this vulnerability (PostgreSQL Release). Red Hat Enterprise Linux 10 users should apply errata RHSA-2026:19009 (Red Hat Errata). IBM Observability with Instana (OnPrem) users should refer to IBM's advisory for updated package versions (IBM Advisory). As a temporary workaround where patching is not immediately possible, disable the pg_trgm extension (DROP EXTENSION pg_trgm;) if it is not required, and restrict database access to trusted users only.

Community reactions

Security Online Info covered the vulnerability as part of a broader report on PostgreSQL fixing five security flaws, noting the potential for critical code execution risks (Security Online). The vulnerability received standard coverage from vulnerability tracking platforms and Linux distribution security channels, with no notable controversy or exceptional researcher commentary identified.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

postgresql-15

Fixed

sid

postgresql-18: 18.2-1

Fixed

trixie

postgresql-17

Fixed

Ubuntu

Unknown

bionic (esm-infra)

postgresql-10

Not Affected

devel

postgresql-18

Not Affected

focal (esm-infra)

postgresql-12

Not Affected

jammy

postgresql-14

Not Affected

noble

postgresql-16

Not Affected

questing

postgresql-17

Not Affected

resolute

postgresql-18

Not Affected

trusty (esm-infra-legacy)

postgresql-9.3

Deferred

RHEL / CentOS

Fixed

RHEL 9

postgresql18.src

Affected

RHEL 10

postgresql18-0:18.3-1.el10_2.src

Fixed

Alpine

Fixed

edge

postgresql16: 16.12-r0, 16.13-r0

Fixed

v3.20

postgresql15: 15.16-r0, 15.17-r0, 16.12-r0, 16.13-r0

Fixed

v3.21

postgresql15: 15.17-r0

Fixed

v3.22

postgresql15: 15.16-r0, 15.17-r0

Fixed

v3.23

postgresql16: 16.12-r0, 16.13-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