CVE-2025-1094 is a high-severity SQL injection vulnerability in PostgreSQL client-side components caused by improper neutralization of quoting syntax in the libpq escaping functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn(), as well as related PostgreSQL command-line utility handling. The flaw arises in specific usage patterns where applications treat the output of these escaping routines as safe and then use that output to construct input for psql, the PostgreSQL interactive terminal. Under affected encoding conditions, malformed multibyte input can survive escaping in a way that causes psql to reinterpret the resulting SQL stream and permit injection. A related variant affects PostgreSQL command-line utility programs when client_encoding is BIG5 and server_encoding is EUC_TW or MULE_INTERNAL. Affected versions are PostgreSQL releases before 17.3, 16.7, 15.11, 14.16, and 13.19.
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
If you can’t patch tonight, do this now.
Patch, then assume compromise.
6 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos.
This repository is a self-contained proof-of-concept for CVE-2025-1094 targeting PostgreSQL client-side components libpq and psql. It is not a framework module; it consists of a small Dockerized lab plus a Python exploit script. The structure is straightforward: docker-compose.yml launches a PostgreSQL 16.6 database and a Flask web app; app/app.py contains the intentionally vulnerable logic; app/init_db.sql seeds a demo employees table; app/Dockerfile builds the vulnerable web container; exolit.py is the external exploit client; README.md documents the vulnerability, payload construction, and usage. The main exploit capability is remote command execution through a web-exposed SQL injection path. In app/app.py, the /search POST handler manually extracts raw form bytes from the request body, decodes them with urllib.parse.unquote_to_bytes, and passes the attacker-controlled bytes to libpq.PQescapeLiteral via ctypes. The resulting escaped string is interpolated into SQL and then sent to the psql CLI through subprocess.Popen(['psql', db_url], stdin=PIPE, ...). This design is the core of the exploit: the PoC relies on an invalid multibyte byte sequence (0xC0) causing a mismatch between libpq escaping and psql parsing, allowing the attacker to break out of the SQL literal and inject psql meta-commands such as \! to execute shell commands. The included exploit script exolit.py sends a POST request to http://localhost:5000/search with a bytes payload: hax\xc0'; \! id; \! ls /tmp; #. On success, it parses the HTML response and looks for uid= output, indicating that shell commands executed in the target container context. The README further documents a reverse shell adaptation using bash and /dev/tcp/<ip-hacker>/<port-hacker>. Overall, this is an operational PoC rather than a mere detector: it actively exploits the vulnerable flow and demonstrates post-exploitation command execution. The attack surface is primarily web/network-based via the Flask endpoint, while the actual vulnerability is triggered in the local interaction between the application, libpq, and the psql subprocess.
Repository purpose: an educational, dockerized PoC/demo for CVE-2025-1094 (PostgreSQL/libpq multi-byte SQL injection) as it can manifest in Node.js apps using pg-native/libpq with unsafe escaping and string concatenation. Core exploit capability: - Remote (HTTP) SQL injection via the login API by abusing backslash-quote escaping when standard_conforming_strings=off and client encoding is BIG5. The crafted multi-byte character (documented as 許, U+8A31, BIG5 bytes 0xBF 0x5C) causes the inserted escape backslash (0x5C) to be interpreted as part of a multi-byte sequence, leaving the following single quote unescaped. This breaks out of the SQL string and enables conditions like OR 1=1, resulting in authentication bypass and disclosure of admin data (secret_data). How it is implemented: - backend/server.js: Express server exposing: - POST /login: vulnerable path. It calls vulnerableEscape() (a simplified simulation of libpq 15.10 backslash escaping) and then concatenates into: SELECT * FROM users WHERE username = '${escapedUser}' AND password = 'dummy_pass'. Successful injection returns the first row (admin) including secret_data. - POST /debug-escape: returns input/escaped strings and their hex bytes to illustrate the encoding/escaping behavior. - GET /users and GET /health: demo convenience endpoints; /health fingerprints the demo as CVE-2025-1094 with BIG5 and libpq 15.10. - docker-compose.yml: orchestrates a vulnerable setup: - PostgreSQL 16 initialized with EUC_TW encoding (POSTGRES_INITDB_ARGS) and exposed on 5432. - Node.js web container built from backend/Dockerfile, exposed on 3000, with env DB_HOST=db, DB_PASS=secretpassword, and PGCLIENTENCODING=BIG5; mounts frontend to /app/public. - backend/Dockerfile: pins Debian snapshot and installs libpq 15.10 packages (explicitly vulnerable) so pg-native compiles against that version. - database/init.sql: creates users table and inserts an admin row containing secret_data (NUCLEAR_ACTIVATION_CODE: 999-666). - frontend/index.html: single-page UI that auto-injects the malicious payload when the user types "hack" and POSTs to /login. - test-exploit.js: automated local test suite hitting http://localhost:3000 endpoints; includes multiple payload variants (OR 1=1, OR 'x'='x', targeted extraction, UNION attempt). Note: the changelog/docs indicate the correct working character is 許; the test script still includes older examples using \u00A3/\u00A5. Overall structure: - Top-level README points to the CVE-2025-1094 demo. - cve-2025-1094-demo/ contains runnable demo (backend, frontend, database, docker-compose) plus extensive Learning/ documentation (guides, diagrams, security mitigations, changelog). The project is primarily a teaching aid rather than a stealthy exploit; it provides clear reproduction steps, a UI, and a scripted tester.
This repository contains a working exploit for CVE-2025-1094, targeting a SQL injection vulnerability in PostgreSQL (versions before 17.3, 16.7, 15.11, 14.16, and 13.19). The exploit is implemented in a single Python script (CVE-2025-1094.py) and is accompanied by a detailed README.md. The attack chain involves three main steps: (1) exploiting a SQL injection vulnerability to read sensitive files (e.g., /etc/passwd) and write them to a temporary location on the server, (2) hijacking a WebSocket connection to execute a remote code execution (RCE) payload, and (3) establishing a reverse shell from the target server to the attacker's machine. The script requires the attacker to specify their own IP and port for the reverse shell, as well as the target's vulnerable HTTP and WebSocket endpoints. The exploit demonstrates a practical attack path from SQL injection to full RCE via WebSocket hijacking, and is operational with a hardcoded payload. The repository is well-structured, with clear instructions and mitigation advice in the README.
This repository contains a Python exploit (exploit.py) and a detailed README.md targeting CVE-2025-1094, a PostgreSQL input sanitization vulnerability affecting the handling of multi-byte encodings (BIG5) in libpq and psql. The exploit abuses improper input sanitization in web applications that pass user input directly to PostgreSQL via psql with BIG5 encoding. The Python script sets the required environment variable, crafts a SQL injection payload that leverages the COPY TO PROGRAM feature to execute a reverse shell, and sends it to a specified vulnerable web endpoint. The README provides comprehensive background, usage instructions, and mitigation advice. The exploit requires the target to use psql (not parameterized drivers), allow COPY TO PROGRAM (superuser), and have outbound connectivity. The main fingerprintable endpoints are the target web application's search endpoint and the attacker's IP/port for the reverse shell. The exploit is operational and can be adapted for file read or shell access depending on the target's configuration.
This repository provides a proof-of-concept (PoC) exploit for CVE-2025-1094, a critical SQL injection vulnerability in PostgreSQL affecting versions prior to 17.3, 16.7, 15.11, 14.16, and 13.19. The exploit demonstrates how an attacker can leverage an encoding mismatch (server_encoding=EUC_TW, client_encoding=BIG5) to inject arbitrary SQL via a vulnerable Flask web application endpoint (/vuln-endpoint). The repository includes a Docker-based emulation environment with a vulnerable Flask app (app.py), a PostgreSQL database configured with the necessary encodings (Dockerfile.db, init.sql), and a Python exploit script (cve-2025-1094-exploit.py) that sends a malicious SQL payload to the vulnerable endpoint. The payload executes a DO block that reads /etc/passwd from the server and writes it to /tmp/payload, demonstrating arbitrary file read and write capabilities. The repository is well-structured for reproducibility, with Dockerfiles and a docker-compose.yml for easy setup. The main attack vector is network-based, targeting the HTTP endpoint exposed by the Flask app. Key fingerprintable endpoints include the vulnerable HTTP URL, and the files /etc/passwd and /tmp/payload on the server. The exploit is a functional PoC and not weaponized, as it requires a specific environment and does not provide a customizable payload interface.
This repository provides a proof-of-concept exploit for CVE-2025-1094, a vulnerability in PostgreSQL that enables SQL injection leading to remote code execution via WebSocket hijacking. The repository contains two files: a detailed README.md explaining the vulnerability, attack chain, and mitigation steps, and exploit.py, a Python script implementing the exploit. The script first performs SQL injection against a specified HTTP endpoint to read sensitive files (e.g., /etc/passwd) and save them on the server. It then hijacks a WebSocket connection to execute a Python-based reverse shell payload, connecting back to the attacker's machine. The exploit requires the attacker to specify the target's vulnerable HTTP endpoint, WebSocket URL, and their own IP/port for the reverse shell. The exploit demonstrates a full attack chain from SQLi to RCE, and is operational with a hardcoded payload. The main attack vectors are network-based, targeting both HTTP and WebSocket interfaces. The endpoints and file paths used in the exploit are clearly defined in the code.
16 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
A SQL injection vulnerability affecting PostgreSQL's psql tool, reportedly exploited in targeted attacks alongside a BeyondTrust zero-day.
A critical SQL injection vulnerability in an underlying PostgreSQL tool, described as required in an exploit chain with CVE-2024-12356.
A critical SQL injection vulnerability in an underlying PostgreSQL tool, referenced as a required link in an exploit chain with CVE-2024-12356.
Referenced vulnerability mentioned only in supporting references; no substantive details are provided in the content.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.