PostgreSQL Vulnerability: Insecure File Creation in pg_upgrade

postgresql Updated 02 Oct 2025

Summary

09/02/2018
N/A
Yes i
High
7.0

ALPINE-CVE-2018-1053: In postgresql 9.3.x before 9.3.21, 9.4.x before 9.4.16, 9.5.x before 9.5.11, 9.6.x before 9.6.7 and 10.x before 10.2, pg_upgrade creates file in current working directory containing the output of pg_dumpall -g under umas... Affects postgresql versions < 10.2-r0. Fixed in 10.2-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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

PostgreSQL is a powerful, open-source relational database management system that uses and extends the SQL language. It is known for its robustness, extensibility, and support for advanced data types. However, certain versions of PostgreSQL are vulnerable to a security issue where the pg_upgrade utility creates files in the current working directory with improper permissions, potentially exposing sensitive information.

Vulnerability Detail

In PostgreSQL versions 9.3.x before 9.3.21, 9.4.x before 9.4.16, 9.5.x before 9.5.11, 9.6.x before 9.6.7, and 10.x before 10.2, the pg_upgrade tool creates a file in the current working directory containing the output of 'pg_dumpall -g' with the prevailing umask instead of the secure 0077. This can allow an authenticated attacker to read or modify the file, which may contain sensitive database passwords, leading to unauthorized access or data breaches.

How To Fix

Minimum fixed version

10.2-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, ensure that the current working directory has restrictive permissions that prevent unauthorized access. Additionally, avoid running pg_upgrade in directories where sensitive information may be exposed.

Conclusion

The PostgreSQL vulnerability related to insecure file creation in pg_upgrade poses significant risks to database security. It is crucial for users to update their PostgreSQL installations to the latest versions to mitigate these risks and protect sensitive data.

See every vulnerability recorded for postgresql →

Share this vulnerability

FAQ

Versions 9.3.x before 9.3.21, 9.4.x before 9.4.16, 9.5.x before 9.5.11, 9.6.x before 9.6.7, and 10.x before 10.2 are affected.

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

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

The risks include unauthorized access to sensitive information, such as database passwords, which could lead to data breaches or unauthorized modifications.

Yes, the permanent fix is to update PostgreSQL to the latest patched version as specified in the 'how to fix' section.

Related vulnerabilities

Recent vulnerabilities recorded for postgresql.

How To Fix

Minimum fixed version

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