SQL Injection Vulnerability in PostgreSQL Packages: CVE-2025-1094

postgresql14 Updated 02 Oct 2025

Summary

13/02/2025
N/A
Yes i
Unrated
Not published

CVE-2025-1094: Improper neutralization of quoting syntax in PostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() allows a database input provider to achieve SQL injection in cer... Affects postgresql14 versions < 14.17-r0. Fixed in 14.17-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 object-relational database system known for its reliability, feature robustness, and performance. It supports advanced data types and offers extensive functionality for data management. However, certain versions of PostgreSQL, specifically versions prior to 17.3, 16.7, 15.11, 14.16, and 13.19, are vulnerable to SQL injection due to improper neutralization of quoting syntax in its libpq functions and command line utilities.

Vulnerability Detail

CVE-2025-1094 arises from improper neutralization of quoting syntax in PostgreSQL libpq functions such as PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn(). This vulnerability allows a database input provider to execute SQL injection attacks in specific usage patterns, particularly when the function results are used to construct input for psql, the PostgreSQL interactive terminal. Additionally, command line utility programs are also susceptible to SQL injection when client_encoding is set to BIG5 and server_encoding is either EUC_TW or MULE_INTERNAL. The implications of this vulnerability can lead to unauthorized data access or manipulation, posing a significant security risk.

How To Fix

Minimum fixed version

14.17-r0

This is the first release that contains the fix.

sudo apk add --upgrade postgresql14

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

Workaround

As a temporary workaround, avoid using the vulnerable functions to construct SQL queries directly from user input. Instead, implement parameterized queries or prepared statements to mitigate the risk of SQL injection.

Conclusion

CVE-2025-1094 is a critical SQL injection vulnerability affecting several versions of PostgreSQL. Users are strongly advised to update to the latest patched versions to protect their databases from potential exploitation. Implementing best practices for database security, such as using parameterized queries, can further enhance protection against SQL injection attacks.

See every vulnerability recorded for postgresql14 →

Share this vulnerability

FAQ

CVE-2025-1094 is a vulnerability in PostgreSQL that allows for SQL injection due to improper neutralization of quoting syntax in certain libpq functions and command line utilities.

Versions prior to PostgreSQL 17.3, 16.7, 15.11, 14.16, and 13.19 are affected by this vulnerability.

You can use Vulert, a tool that monitors and alerts for open-source vulnerabilities in software. You can check if your application is affected by using the Vulert playground at Vulert Scanner without needing to sign up.

The vulnerability can lead to unauthorized access to the database, data manipulation, and potential data breaches, posing a significant security risk.

If an immediate update is not possible, implement parameterized queries or prepared statements as a workaround to mitigate the risk of SQL injection.

Related vulnerabilities

Recent vulnerabilities recorded for postgresql14.

How To Fix

Minimum fixed version

14.17-r0

This is the first release that contains the fix.

sudo apk add --upgrade postgresql14

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