CVE-2026-6637 is a vulnerability in PostgreSQL's contrib/spi refint module, specifically in the check_foreign_key() trigger logic used to enforce referential integrity. The flaw combines two distinct issues: a stack-based buffer overflow and a separate SQL injection condition. The buffer overflow arose from constructing SQL statements in a fixed-length stack buffer using repeated formatted appends, allowing attacker-controlled input such as sufficiently long key values or column-related data to exceed the buffer boundary. Successful exploitation can allow an unprivileged database user to execute arbitrary code as the operating system account running the PostgreSQL server. A second issue existed in the module's handling of cascade update values, where key values were wrapped in quotes without sufficiently safe escaping. In deployments where an application uses a user-controlled column as a refint cascade primary key and permits user-controlled updates to that column, crafted input can be injected into the generated SQL and executed in the database context of the user performing the primary key update. Affected versions are PostgreSQL releases before 18.4, 17.10, 16.14, 15.18, and 14.23.
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
If you can’t patch tonight, do this now.
Patch, then assume compromise.
No public exploits tracked yet. Mallory keeps watching.
No public exploit code observed for this vulnerability.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
39 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
A PostgreSQL vulnerability affecting contrib/spi, described as involving prevention of SQL injection and buffer overruns.
A critical vulnerability in PostgreSQL's refint module involving a stack buffer overflow that can allow arbitrary code execution as the PostgreSQL OS account, and in a separate scenario can trigger SQL injection via crafted primary key updates.
A PostgreSQL contrib/spi vulnerability combining SQL injection and buffer overrun risks in check_foreign_key() due to improper quoting and fixed-length query buffers.
A PostgreSQL contrib/spi vulnerability involving SQL injection and buffer overruns in check_foreign_key() due to improper quoting and fixed-length query buffers.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.