Improper Neutralization of Quoting Syntax Affecting postgresql package, versions [,13.19)[14.0,14.16)[15.0,15.11)[16.0,16.7)[17.0,17.3)


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Social Trends
Exploit Maturity
Proof of Concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UNMANAGED-POSTGRESQL-8722244
  • published14 Feb 2025
  • disclosed13 Feb 2025
  • creditStephen Fewer

Introduced: 13 Feb 2025

NewCVE-2025-1094  (opens in a new tab)
CWE-149  (opens in a new tab)

How to fix?

Upgrade postgresql to version 13.19, 14.16, 15.11, 16.7, 17.3 or higher.

Overview

Affected versions of this package are vulnerable to Improper Neutralization of Quoting Syntax in the psql tool via the libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn(). An attacker could achieve arbitrary code execution by leveraging the interactive tool’s ability to run meta-commands which run shell commands with the privileges of the service. Meta-commands extend the interactive tool's functionality by providing a wide variety of additional operations that the interactive tool can perform. The meta-command, identified by the exclamation mark symbol, allows an operating system shell command to be executed.

Note:

This is only exploitable if the application uses the function result to construct input to psql. Similarly, improper neutralization of quoting syntax in PostgreSQL command line utility programs allows a source of command line arguments to achieve SQL injection when client_encoding is BIG5 and server_encoding is one of EUC_TW or MULE_INTERNAL.

CVSS Scores

version 4.0
version 3.1