Critical SQL Injection Vulnerability in PostgreSQL: CVE-2020-25695

postgresql Updated 02 Oct 2025

Summary

16/11/2020
N/A
Yes i
High
8.8

ALPINE-CVE-2020-25695: 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. Affects postgresql versions < 11.10-r0. Fixed in 11.10-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

PostgreSQL is a powerful, open-source object-relational database system known for its robustness, extensibility, and standards compliance. It supports a wide range of data types and offers advanced features such as multi-version concurrency control, complex queries, and full-text search. However, a critical vulnerability (CVE-2020-25695) has been identified, affecting various versions of PostgreSQL, which could allow attackers to execute arbitrary SQL functions with superuser privileges if they have permission to create non-temporary objects in a schema.

Vulnerability Detail

CVE-2020-25695 is a significant security flaw found in PostgreSQL versions prior to 13.1, 12.5, 11.10, 10.15, 9.6.20, and 9.5.24. The vulnerability arises from improper permission handling, allowing an attacker with the ability to create non-temporary objects in a schema to execute arbitrary SQL functions as a superuser. This can lead to severe consequences, including unauthorized access to sensitive data, data integrity issues, and potential system downtime. The CVSS score for this vulnerability is 8.8, indicating a high level of risk.

How To Fix

Minimum fixed version

11.10-r0

This is the first release that contains the fix.

sudo apk add --upgrade postgresql

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate upgrading is not feasible, consider restricting permissions for users who can create non-temporary objects in schemas. This can help mitigate the risk until the package is updated. Additionally, review and monitor database access logs for any suspicious activities.

Conclusion

CVE-2020-25695 represents a serious security risk for PostgreSQL users, allowing unauthorized access to superuser privileges under certain conditions. It is essential to upgrade to the latest patched versions to mitigate this vulnerability and ensure the integrity and confidentiality of your data.

See every vulnerability recorded for postgresql →

Share this vulnerability

FAQ

CVE-2020-25695 is a critical vulnerability in PostgreSQL that allows attackers to execute arbitrary SQL functions as a superuser if they have permission to create non-temporary objects in a schema.

The vulnerability affects PostgreSQL versions before 13.1, 12.5, 11.10, 10.15, 9.6.20, and 9.5.24.

You can use Vulert, a tool that monitors open-source vulnerabilities in your software. By simply uploading your manifest file, you can check for vulnerabilities without needing to access the code.

As a temporary measure, restrict permissions for users who can create non-temporary objects in schemas and monitor database access logs for suspicious activities.

The CVSS score for CVE-2020-25695 is 8.8, indicating a high level of risk associated with this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for postgresql.

How To Fix

Minimum fixed version

11.10-r0

This is the first release that contains the fix.

sudo apk add --upgrade postgresql

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback