The component PostgreSQL Extension (contrib/pg_trgm/trgm_op.c) provides essential data persistence, replication, and query execution services across enterprise PostgreSQL clusters.
Parameter
Technical Specification
Threat Intelligence Context
CVE Identifier
CVE-2026-2007
Official Upstream Security Release
Affected Product
postgresql:postgresql
Relational Database & Administration Ecosystem
Vulnerable Component
PostgreSQL Extension (contrib/pg_trgm/trgm_op.c)
Database Backend / Tool / Extension
Weakness Class
CWE-122: Heap-based Buffer Overflow
Memory Safety / Authorization Vulnerability
CVSS v3.1 Score
8.2 (HIGH / Hermes Score 85)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
Fixed Version
18.2
Official security patch release
MITRE ATT&CK
T1499 - Endpoint Denial of Service, T1068 - Exploitation for Privilege Escalation
trg->data[i] =pack_trigram(str + i); // Overwrites memory past trg!
}
return trg;
}
When unvetted user input reaches this routine, the database engine miscalculates buffer capacity, bypasses execution sandboxes, or interprets untrusted identifiers as executable SQL syntax.
Initial Vector & Preconditions: An attacker sends crafted fuzzy-search queries via an unauthenticated public web application that executes SELECT * FROM items WHERE title % $1.
Impact Realization: The malformed pattern triggers the heap overflow, immediately crashing the Postgres worker or corrupting surrounding memory contexts..
Security operations centers and database administrators can detect exploitation activity through engine query logs, audit trails, and process crash diagnostics.
Database & Process Telemetry
Inspect PostgreSQL server logs (/var/log/postgresql/) for messages matching:
postgres[pid]: memory corruption detected in pg_trgm similarity calculation. Monitor for abnormal query aborts or sudden backend terminations.