PostgreSQLDatabase / datastore

CVE-2026-2007

HIGH · 8.2 CVSS v3.1 Published 2026-02-12
Fix available
A fix is available. Upgrade to 18.2 or later.
See remediation →
91/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · moderate confidence

Heap buffer overflow vulnerability in PostgreSQL's pg_trgm (trigram) extension allows authenticated database users to overflow heap memory via specially crafted input strings to trigram-related functions. While the attacker has limited control over the bytes written, the severity and potential for privilege escalation warrants serious concern.

MitigationUpgrade PostgreSQL to a version beyond 18.1 that contains the security patch for this vulnerability. If immediate upgrade is not feasible, disable or restrict access to the pg_trgm extension until the patch can be applied.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
PostgreSQLDatabase / datastore
Affected:>= 18.0, < 18.2

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check your PostgreSQL server version
    Run 'SELECT version();' or 'psql -c "SELECT version();"' to obtain the installed PostgreSQL version number.
    Affected if The version is 18.0 or 18.1 (any version >= 18.0 but < 18.2)
  2. Verify pg_trgm extension availability
    Query the pg_available_extensions system catalog: 'SELECT name, default_version FROM pg_available_extensions WHERE name = 'pg_trgm';'
    Affected if The extension shows as available (this means the vulnerability is potentially accessible)
  3. Check if pg_trgm is enabled in any database
    Run 'SELECT datname, extname FROM pg_extension e JOIN pg_database d ON e.extdbid = d.oid WHERE extname = 'pg_trgm';' to list databases with the extension installed.
    Affected if The extension is installed in one or more databases - the vulnerable code path is present
  4. Identify users with pg_trgm function access
    Query 'SELECT routine_name, routine_schema FROM information_schema.routines WHERE routine_name LIKE 'similarity%' OR routine_name LIKE '%trgm%';' to see trigram functions, then check grants with '\df' in psql or query pg_proc and pg_roles.
    Affected if Any authenticated user (especially untrusted ones) has execute permission on pg_trgm functions like similarity(), show_trgm(), etc.

You are affected if your PostgreSQL version is 18.0 or 18.1 AND the pg_trgm extension is installed and accessible to database users.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 18.2 or later
Fixed in 18.2
Interim mitigation

Upgrade PostgreSQL to a version beyond 18.1 that contains the security patch for this vulnerability. If immediate upgrade is not feasible, disable or restrict access to the pg_trgm extension until the patch can be applied.

Recommended fix High confidence

PostgreSQL 18.2 or later

  1. 1. Identify current PostgreSQL version by running: psql --version or SELECT version();
  2. 2. Schedule a maintenance window for the upgrade
  3. 3. Create a full backup of all databases using pg_dump or pg_basebackup
  4. 4. Upgrade PostgreSQL to version 18.2 or later. On most systems: yum update postgresql or apt-get install postgresql-18 (or appropriate package manager)
  5. 5. After upgrade, restart the PostgreSQL service: systemctl restart postgresql
  6. 6. Verify the new version is running: psql --version
  7. 7. Run pg_dumpall to verify all databases are accessible post-upgrade
  8. 8. Test critical application functionality to ensure normal operations
Caveat Minor version upgrades within 18.x are typically seamless; however, always review release notes for any configuration or compatibility changes before upgrading

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in PostgreSQL Scoped from the published advisory
  • Consultation6.0 h
  • Implementation12.0 h
  • Testing10.0 h
  • Review / QA6.0 h
34.0 hours of engineering $5,940
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $9,504.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-2007 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-2007 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data