This vulnerability is trending on Twitter; this may indicate a growing threat.
Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
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 applicationsUpgrade postgresql
to version 13.19, 14.16, 15.11, 16.7, 17.3 or higher.
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
.