Incomplete Safeguards in PostgreSQL Allow Arbitrary SQL Function Execution

postgresql Updated 02 Oct 2025

Summary

31/08/2022
N/A
Yes i
High
8.8

CVE-2022-1552: A flaw was found in PostgreSQL. Affects postgresql versions < 13.7-r0. Fixed in 13.7-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 an open-source relational database management system known for its robustness, scalability, and extensibility. It is widely used in various applications and industries. However, a vulnerability has been discovered in PostgreSQL that could allow an attacker with certain permissions to execute arbitrary SQL functions under a superuser identity. This vulnerability affects the following packages: postgresql, postgresql13, postgresql14, and postgresql15 in the Alpine Linux ecosystem.

Vulnerability Detail

The vulnerability (CVE-2022-1552) arises from incomplete efforts to operate safely when a privileged user is maintaining another user's objects. Several commands, including Autovacuum, REINDEX, CREATE INDEX, REFRESH MATERIALIZED VIEW, CLUSTER, and pg_amcheck, activate relevant protections too late or not at all during the process. This flaw enables an attacker with permission to create non-temporary objects in at least one schema to execute arbitrary SQL functions under a superuser identity. The impact of this vulnerability can be severe, as it allows unauthorized access and potential manipulation of the database.

How To Fix

Minimum fixed version

13.7-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

There is no known workaround for this vulnerability. It is essential to apply the provided fix by updating the affected packages to the fixed versions.

Conclusion

The vulnerability in PostgreSQL (CVE-2022-1552) exposes a significant risk of unauthorized access and manipulation of the database. It is crucial to update the affected packages to the fixed versions to ensure the necessary safeguards are in place. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for postgresql →

Share this vulnerability

FAQ

This vulnerability allows an attacker with certain permissions to execute arbitrary SQL functions under a superuser identity, potentially leading to unauthorized access and manipulation of the database.

The vulnerability affects the following packages in the Alpine Linux ecosystem: postgresql, postgresql13, postgresql14, and postgresql15.

No, there are no known workarounds for this vulnerability. It is crucial to update the affected packages to the fixed versions.

To fix this vulnerability, update the affected packages to the fixed versions: 13.7-r0 for postgresql, postgresql13, postgresql14, and postgresql15 in the Alpine Linux ecosystem.

You can find more information about this vulnerability in the CVE-2022-1552 JSON report available at the following source: https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-1552.json

Related vulnerabilities

Recent vulnerabilities recorded for postgresql.

How To Fix

Minimum fixed version

13.7-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