metasploit-framework icon indicating copy to clipboard operation
metasploit-framework copied to clipboard

CVE‑2025‑1094 (PostgreSQL libpq SQL injection → RCE)

Open happybear-21 opened this issue 6 months ago • 2 comments

Summary

Improper neutralization of quoting syntax in PostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() allows a database input provider to achieve SQL injection in certain usage patterns. Specifically, SQL injection requires the application to use the function result to construct input to psql, the PostgreSQL interactive terminal. 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. Versions before PostgreSQL 17.3, 16.7, 15.11, 14.16, and 13.19 are affected. [Summary was taken from NVD]

References

  • https://nvd.nist.gov/vuln/detail/cve-2025-1094
  • https://access.redhat.com/security/cve/cve-2025-1094
  • https://www.rapid7.com/blog/post/2025/02/13/cve-2025-1094-postgresql-psql-sql-injection-fixed/

happybear-21 avatar Jun 30 '25 15:06 happybear-21

I'll see if I add this, shouldn't be too challenging considering there are already working pocs

ordinary-hacker avatar Aug 20 '25 20:08 ordinary-hacker

well... apparently there's already a module which is linux/http/beyondtrust_pra_rs_unauth_rce. though it seeems to be focused on exploiting this only for Beyondtrust

ordinary-hacker avatar Aug 20 '25 21:08 ordinary-hacker