SQL Injection in PostgreSQL
CVE-2025-1094
Key Information:
- Vendor
PostgreSQL
- Status
- CVE ID
- CVE ID:
- CVE-2025-1094
- Vendor
- CVE Published:
- 13 February 2025
- Fixed in
- Fixed in:
- 17.3, 16.7, 15.11 +2 more
Timeline
Exploit known 1 day after it was published
- π
Vulnerability started trending
- πΎ
Exploit known to exist
- π‘
Public PoC available
- π°
First article discovered by SecurityWeek
Vulnerability published
Vulnerability Reserved
Badges
How risky is it?
- Yes: Works over the network, no login needed
- Yes: Public exploit code (5 proof-of-concepts)
- No: Not on CISA's exploited list
- No: No ransomware use seen
Our verdict
Patch this week
Exploitation is likely. Prioritise the fix.
What to do
1Update to a fixed version
Install the PostgreSQL release that fixes your version line, or later:
2Can't patch yet? Reduce exposure
It can be reached over the network, so limit who can reach PostgreSQL. Block it from the internet, allow only trusted hosts or a VPN, and turn off the affected feature if you don't use it, until you can update.
3Look for signs of compromise
Exploit code is public, so check logs on exposed PostgreSQL systems for unusual requests or new processes from before you patched. The 5 public proof-of-concepts show what an attack looks like.
4Why it's rated "Patch this week"
- Exploit code is public, so attacks are easy to copy.
- It can be exploited remotely without credentials.
- EPSS gives it a 85.3% chance of exploitation in the next 30 days.
- Its CVSS severity is high (8.1).
What is CVE-2025-1094?
CVE-2025-1094 is an SQL injection vulnerability in PostgreSQL's libpq functions and command line utilities. It arises from improper neutralization of quoting syntax in functions such as PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn(). An attacker can exploit this flaw by providing crafted input that leads to SQL injection when the application uses the function result to construct input for the PostgreSQL interactive terminal (psql). This can result in arbitrary code execution through the execution of meta-commands or attacker-controlled SQL statements.
Versions before PostgreSQL 17.3, 16.7, 15.11, 14.16, and 13.19 are affected. A fix was released on February 13, 2025. This vulnerability was exploited in a notable attack against the US Treasury, where it was used in conjunction with another vulnerability to achieve remote code execution.
Potential Impact of CVE-2025-1094
-
Arbitrary code execution: An attacker can execute arbitrary commands on the operating system by leveraging the psql tool's ability to run meta-commands.
-
Unauthorized data access: Successful exploitation can allow attackers to access sensitive documents and data within the database.
Exploit Proof of Concept (PoC)
PoC code is written by security researchers to demonstrate the vulnerability can be exploited. PoC code is also a key component for weaponization which could lead to ransomware.
News Articles
Serious PostgreSQL flaw exploited in US Treasury zero-day attack - Techerati
Researchers believe a zero-day weakness in PostgreSQL played a major role in hacks that were able to successfully breach the US Treasury.
PostgreSQL vulnerability exploited in US Treasury attack
Discover how a critical PostgreSQL vulnerability led to a significant cyberattack on the US Treasury, exposing sensitive financial data.
A PostgreSQL zero-day was also exploited in US Treasury hack (CVE-2025-1094)Β
Rapid7 researchers have discovered that the Chinese state-sponsored hackers suspected of being behind the U.S. Treasury attack in December leveraged a
References
More PostgreSQL Vulnerabilities
Type Confusion Vulnerability in PostgreSQL Database Software
Type Confusion Vulnerability in PostgreSQL Database Management System
Integer Wraparound Vulnerability in PostgreSQL Database Management System
Facts on this page come from the sources listed above; the writeup is AI-assisted. How we rate vulnerabilities Β· Report a correction
EPSS Score
85% chance of being exploited in the next 30 days.
