CVE-2026-2007

PostgreSQL pg_trgm heap buffer overflow writes pattern onto server memory

Published Feb 12, 2026 CVSS 3.1 · 8.2 High EPSS < 1% KEV · Not listed
Description
Heap buffer overflow in PostgreSQL pg_trgm allows a database user to achieve unknown impacts via a crafted input string. The attacker has limited control over the byte patterns to be written, but we have not ruled out the viability of attacks that lead to privilege escalation. PostgreSQL 18.1 and 18.0 are affected.

Analysis

AI-generated

Technical impact

Heap buffer overflow in the PostgreSQL pg_trgm module enables an attacker with database access to write crafted byte patterns to heap memory. The vulnerability is triggered by a malformed input string and may result in memory corruption or code execution, potentially allowing privilege escalation. It is a classic buffer overflow weakness categorized as CWE-120 and CWE-122.

Affected Systems

The affected product is PostgreSQL, versions 18.0 and 18.1. No other versions are reported as vulnerable.

Risk and Exploitability

The CVSS score of 8.2 signifies high severity. The EPSS score is reported as less than 1 %, indicating a very low but non-zero probability of exploitation at present. The vulnerability is not listed in the CISA KEV catalog. The attack vector is inferred to be a remote attacker who can send a crafted SQL query to a PostgreSQL server that has the pg_trgm module enabled and whose user has sufficient privileges to invoke the vulnerable function. Attackers would need to construct a specific input pattern to trigger the overflow; however, the limited control over byte patterns does not rule out the feasibility of privilege escalation attacks.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Check for an official patch or upgrade to a later PostgreSQL release that resolves the pg_trgm buffer overflow issue.
  • If a patch is not yet available, disable the pg_trgm extension or restrict its usage to trusted users or applications.
  • Limit database user privileges to the minimum necessary and ensure the database is not exposed to untrusted networks.

Generated by OpenCVE AI on April 17, 2026 at 20:04 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Postgresql
Postgresql postgresql
Vendors & Products Postgresql
Postgresql postgresql
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Heap buffer overflow in PostgreSQL pg_trgm allows a database user to achieve unknown impacts via a crafted input string. The attacker has limited control over the byte patterns to be written, but we have not ruled out the viability of attacks that lead to privilege escalation. PostgreSQL 18.1 and 18.0 are affected.
Title PostgreSQL pg_trgm heap buffer overflow writes pattern onto server memory
Weaknesses CWE-122
References
Metrics cvssV3_1

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

Weaknesses
  • CWE-120

    Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

  • CWE-122

    Heap-based Buffer Overflow

Sources

Status
PUBLISHED
Assigner
PostgreSQL
Published
Updated
Jul 15, 2026, 1:20 AM
Reserved
Feb 5, 2026, 6:17 PM
Status
Modified
Published
Feb 12, 2026, 2:16 PM
Modified
Jul 15, 2026, 2:19 AM
Severity
Important
Public date
Feb 12, 2026, 1:00 PM