SQL Injection in PostgreSQL

Patch this weekFull system takeover over the network, no login needed.
8.1HIGH

CVE-2025-1094

Key Information:

Vendor

PostgreSQL

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

πŸ“ˆ TrendedπŸ“ˆ Score: 7,490πŸ‘Ύ Exploit Exists🟑 Public PoC🟣 EPSS 85%πŸ“° News Worthy

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
PostgreSQL 17 to below 17.3 is vulnerable
PostgreSQL 16 to below 16.7 is vulnerable
PostgreSQL 15 to below 15.11 is vulnerable
PostgreSQL 14 to below 14.16 is vulnerable
PostgreSQL 0 to below 13.19 is vulnerable

Install the PostgreSQL release that fixes your version line, or later:

17.316.715.1114.1613.19
Read the vendor advisory β†—
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

  1. Arbitrary code execution: An attacker can execute arbitrary commands on the operating system by leveraging the psql tool's ability to run meta-commands.

  2. 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.

favicon imageoodaloop.com

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

Type Confusion Vulnerability in PostgreSQL Database Software

CVE-2026-6460
PostgreSQLPostgresqlπŸ˜„πŸ‘Ύ8.8HIGH

Type Confusion Vulnerability in PostgreSQL Database Management System

CVE-2026-116331
PostgreSQLPostgresqlπŸ˜„πŸ‘Ύ8.8HIGH

Integer Wraparound Vulnerability in PostgreSQL Database Management System

CVE-2026-116328
PostgreSQLPostgresql8.8HIGH
View more PostgreSQL vulnerabilities...

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.

CVSS V3.1

Score:
8.1
Severity:
HIGH
Confidentiality:
High
Integrity:
High
Availability:
High
Attack Vector:
Network
Attack Complexity:
High
Privileges Required:
None
User Interaction:
None
Scope:
Unchanged

Credit

The PostgreSQL project thanks Stephen Fewer, Principal Security Researcher, Rapid7 for reporting this problem.
.