Critical Vulnerability in PostgreSQL: Code Execution Risk for Users

postgresql Updated 02 Oct 2025

Summary

02/03/2018
N/A
Yes i
High
8.8

ALPINE-CVE-2018-1058: A flaw was found in the way Postgresql allowed a user to modify the behavior of a query for other users. Affects postgresql versions < 10.3-r0. Fixed in 10.3-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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

PostgreSQL is a powerful, open-source relational database management system that uses and extends the SQL language. It is known for its reliability, feature robustness, and performance. However, a significant vulnerability has been identified that allows attackers with user accounts to manipulate query behaviors, potentially leading to unauthorized code execution with superuser permissions.

Vulnerability Detail

A flaw was found in PostgreSQL that permits a user to alter the behavior of a query for other users. This vulnerability, identified as CVE-2018-1058, affects versions 9.3 through 10. An attacker with a user account could exploit this flaw to execute arbitrary code with superuser privileges in the database, posing severe security risks including data breaches and unauthorized access.

How To Fix

Minimum fixed version

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

As a temporary workaround, restrict user permissions and limit the ability of users to execute queries that could be manipulated. This can be done by reviewing and adjusting user roles and privileges within the PostgreSQL database.

Conclusion

The identified vulnerability in PostgreSQL poses a significant risk, allowing attackers to execute code with elevated privileges. It is crucial for users to update to the patched versions to mitigate this risk and ensure the security of their databases.

See every vulnerability recorded for postgresql →

Share this vulnerability

FAQ

Versions 9.3 through 10 are affected by this vulnerability.

An attacker could execute arbitrary code with superuser privileges, leading to potential data breaches and unauthorized access.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The CVSS score of this vulnerability is 8.8, indicating a high severity level.

Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities using just a manifest file like package-lock.json.

Related vulnerabilities

Recent vulnerabilities recorded for postgresql.

How To Fix

Minimum fixed version

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