A PostgreSQL zero-day was also exploited in US Treasury hack (CVE-2025-1094)
Vulnerabilities mentionedAll →
| CVE | Vulnerability | CVSS | EPSS | Flags | Affected | Exposure | Published |
|---|---|---|---|---|---|---|---|
| CVE-2024-12356 | Unauthenticated Command Injection in BeyondTrust Privileged Remote Access/Remote Support BeyondTrust Privileged Remote Access (PRA) and Remote Support (RS) contain an unauthenticated command injection flaw (CWE-77) that allows a remote attacker to inject commands that are executed as a site user. The vulnerability is network-facing with low attack complexity and requires no privileges or user interaction (CVSS 3.1: AV:N/AC:L/PR:N/UI:N), so any attacker who can reach the affected PRA/RS interface can trigger it. Successful exploitation yields arbitrary command execution in the context of the site user, with high impact ratings for confidentiality, integrity, and availability. Any organization running BeyondTrust PRA or RS — particularly where those remote-access/remote-support services are exposed to the internet — is affected; the available data does not specify affected version ranges. The flaw is being actively exploited: it was added to CISA's Known Exploited Vulnerabilities catalog on 2024-12-19, carries an 88% EPSS probability of exploitation within 30 days (100th percentile), and was reportedly used in the breach of the U.S. Treasury alongside a PostgreSQL vulnerability. Do: Apply BeyondTrust's patches or vendor-specified mitigations immediately — remediation is mandatory for U.S. federal agencies under the KEV listing, and the source data does not include fixed build numbers, so confirm the correct upgrade version in BeyondTrust's security bulletin. As an interim measure, restrict or remove internet exposure of PRA/RS endpoints and hunt for signs of exploitation (unexpected commands executed as the site user), noting this flaw was used in the U.S. Treasury intrusion. If mitigations are unavailable, CISA's required action is to discontinue use of the product. | 9.8 | 88% | KEV PoC |
| moderate≈ a few thousand internet-exposed PRA/RS instances (order-of-magnitude estimate from public internet scans) | |
| CVE-2025-1094 | SQL Injection in PostgreSQL libpq escaping functions and command-line tools Improper neutralization of quoting syntax (CWE-149) in PostgreSQL's libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn(), and in PostgreSQL command-line utility programs, allows SQL injection. SQL injection is triggered when an application takes attacker-influenced database input, escapes it with these functions, and uses the result to construct input passed to the psql interactive terminal; the command-line utility variant requires client_encoding BIG5 with server_encoding EUC_TW or MULE_INTERNAL. An attacker who exploits this can run arbitrary SQL, with high confidentiality, integrity, and availability impact (CVSS 3.1: 8.1, high). All PostgreSQL releases before 17.3, 16.7, 15.11, 14.16, and 13.19 are affected across cloud and self-hosted deployments, though real-world exploitability depends on the specific usage patterns described. The flaw was exploited as a zero-day before the fixes, including in the US Treasury Department breach and in targeted attacks chained with a BeyondTrust zero-day, and EPSS puts the 30-day exploitation probability at 90%. Do: Upgrade all PostgreSQL installations to version 17.3, 16.7, 15.11, 14.16, or 13.19 (or later). Audit application code paths that pass libpq-escaped values (PQescapeLiteral/PQescapeIdentifier/PQescapeString/PQescapeStringConn) into psql, and check any use of PostgreSQL command-line utilities where client_encoding is BIG5 and server_encoding is EUC_TW or MULE_INTERNAL. Because this flaw was chained with the BeyondTrust zero-day in targeted attacks, review the exposure of remote-access appliances and hunt for anomalous SQL/psql activity. | 8.1 | 90% |
| mass≈1,000,000+ PostgreSQL installations; hundreds of thousands of PostgreSQL servers exposed on the public internet per public scans |
Full article394 words · extracted from helpnetsecurity.com · click to collapse
The suspected Chinese state-sponsored hackers who breached workstations of several US Treasury employees in December 2024 did so by leveraging not one, but two zero-days, according to Rapid7 researchers.

It was initially reported that the attackers compromised the Treasury’s BeyondTrust Remote Support SaaS instances via CVE-2024-12356, a previously unknown unauthenticated command injection vulnerability.
But, as Rapid7 researchers discovered (and confirmed by testing), “a successful exploit for CVE-2024-12356 had to include exploitation of CVE-2025-1094 in order to achieve remote code execution.”
About CVE-2025-1094
CVE-2025-1094 is a vulnerability stemming from how the PostgreSQL interactive tool (psql) handles certain invalid byte sequences from invalid UTF-8 characters, and can be leveraged for SQL injection.
“An attacker who can generate a SQL injection via CVE-2025-1094 can then achieve arbitrary code execution (ACE) by leveraging the interactive tool’s ability to run meta-commands,” Stephen Fewer, Principal Security Researcher at Rapid7, explained.
“The meta-command, identified by the exclamation mark symbol, allows for an operating system shell command to be executed. Alternatively, an attacker who can generate a SQL injection via CVE-2025-1094 can execute arbitrary attacker-controlled SQL statements.”
During his research, he also discovered that before BeyondTrust released the patch for CVE-2024-12356 in mid-December 2024, CVE-2025-1094 was also exploitable on vulnerable Remote Support targets without leveraging CVE-2024-12356.
Fixes are available
The PostgreSQL team has been notified and they issued fixes for CVE-2025-1094 on February 13, 2025.
The good news is that the BeyondTrust December patches also mitigated the risk of attackers leveraging the PostgreSQL zero-day to target BeyondTrust’s Privileged Remote Access (PRA) and Remote Support (RS) solutions.
Caitlin Condon, vulnerability research director at Rapid7, also says that CVE-2025-1094 is non-trivial to exploit and that they don’t expect to see it exploited in PostgreSQL implementations outside known-vulnerable BeyondTrust RS and PRA versions.
But, she added, “it’s clear that the adversaries who perpetrated the December attack *really* knew the target technology.”
PostgreSQL users are advised to upgrade to a fixed PostgreSQL version: 17.3, 16.7, 15.11, 14.16, or 13.19.
BeyondTrust users that haven’t yet implement the December 2024 fix should do so promptly. Rapid7 has released technical details on both zero-days, and has shared indicators of compromise (error messages in logs) that could point to CVE-2025-1094 having been exploited on BeyondTrust Remote Support instances.

Subscribe to our breaking news e-mail alert to never miss out on the latest breaches, vulnerabilities and cybersecurity threats. Subscribe here!

Text extracted automatically; images, tables and formatting may be missing. Original: https://www.helpnetsecurity.com/2025/02/17/a-postgresql-zero-day-was-also-exploited-in-us-treasury-hack-cve-2025-1094/