CVE-2025-61385 pg8000 SQL injection vulnerability via a specially crafted Python list input

Critical 9.6 Published Updated

Remote attackers can execute arbitrary SQL commands via crafted input in the pg8000 library, potentially compromising database integrity and confidentiality.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2025-61385?

CVE-2025-61385 is a critical SQL injection vulnerability in n/a, published on 27 Oct 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

SQL injection vulnerability in tlocke pg8000 1.31.4 allows remote attackers to execute arbitrary SQL commands via a specially crafted Python list input to function pg8000.native.literal.

Weakness: CWE-89

Which versions are affected by CVE-2025-61385?

3 open source packages ship an affected version, including pg8000.

PackageAffectedFixed in
pg8000 PyPIAll versions1.31.5
pg8000 PyPIAll versions1.31.5
pg8000 PyPIAll versions1.31.5

How do I fix CVE-2025-61385?

Upgrade pg8000 to 1.31.5 or later.

Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.

Is CVE-2025-61385 being exploited?

There is no known exploitation of CVE-2025-61385 in the wild and no public exploit code.

Sources

Also known as GHSA-wq2g-r956-j8cc, PYSEC-2026-1766.

Is CVE-2025-61385 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free