PostgreSQLDatabase / datastore

CVE-2020-25695

HIGH · 8.8 CVSS v3.1 Published 2020-11-16
Fix available
A fix is available. Upgrade to 9.5.24 / 9.6.20 or later.
See remediation →
94/100
Remediation priority · Urgent
Remotely reachable 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
A flaw was found in PostgreSQL versions before 13.1, before 12.5, before 11.10, before 10.15, before 9.6.20 and before 9.5.24. An attacker having permission to create non-temporary objects in at least one schema can execute arbitrary SQL functions under the identity of a superuser. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.

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 · high confidence

A privilege escalation vulnerability in PostgreSQL allows attackers with CREATE permission on any schema to execute arbitrary SQL functions under superuser identity, bypassing intended permission boundaries.

MitigationUpgrade PostgreSQL to versions 13.1, 12.5, 11.10, 10.15, 9.6.20, 9.5.24 or later. Review schema permissions to limit non-superuser CREATE privileges until patching is complete.

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:< 9.5.24>= 9.6.0, < 9.6.20>= 10.0, < 10.15>= 11.0, < 11.10>= 12.0, < 12.5>= 13.0, < 13.1
Debian LinuxOperating system
Affected:= 9.0

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
Low
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/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 PostgreSQL version
    Run `psql -c "SELECT version();"` or `SELECT pg_postmaster_start_time();` to identify the installed PostgreSQL version number.
    Affected if The version falls into any of these ranges: < 9.5.24, >= 9.6.0 and < 9.6.20, >= 10.0 and < 10.15, >= 11.0 and < 11.10, >= 12.0 and < 12.5, or >= 13.0 and < 13.1.
  2. List all schemas and owners
    Run `SELECT nspname, nspowner::regrole FROM pg_namespace WHERE nspname NOT LIKE 'pg_%' AND nspname NOT LIKE 'information_schema';` to see user-defined schemas and their owners.
    Affected if There are user-defined schemas in the database.
  3. Check CREATE permission on schemas
    Run `SELECT grantee, schema_name, privilege_type FROM information_schema.schema_privileges WHERE privilege_type = 'CREATE';` to identify roles with CREATE privilege on any schema.
    Affected if Any non-superuser role (not postgres) has CREATE privilege on any schema.
  4. Identify superuser roles
    Run `SELECT rolname FROM pg_roles WHERE rolsuper = true;` to list superuser accounts.
    Affected if There is at least one superuser account in the database (this is the typical vulnerable configuration).

The environment is affected if the PostgreSQL version is in the vulnerable range AND there exist non-superuser roles with CREATE permission on any user-defined schema.

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.

From vendor data
Upgrade available Upgrade to 9.5.24 / 9.6.20 / 10.15 or later
Fixed in 9.5.249.6.2010.15
Interim mitigation

Upgrade PostgreSQL to versions 13.1, 12.5, 11.10, 10.15, 9.6.20, 9.5.24 or later. Review schema permissions to limit non-superuser CREATE privileges until patching is complete.

Fix this in PostgreSQL Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing6.0 h
  • Review / QA2.0 h
20.0 hours of engineering $3,500
Get the upgrade done

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

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2020-25695 — 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-2020-25695 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