External risk intelligence

SQL Injection in pg8000 via Python List Input

CVE advisorySeverity: CRITICAL (CVSS 9.6)

CVE-2025-61385

The vulnerability exists in a Python database driver library, pg8000. While it is network-reachable via applications that utilize the library, the library itself is a backend component rather than a standalone internet-facing service or appliance. Its exposure depends entirely on how a developer implements it within an application, making public internet reachability possible but not a standard deployment pattern.

SQL Injection

Halo Surface Signal: 3 out of 5 — possibly public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

A critical vulnerability exists in the pg8000 Python database driver, allowing remote attackers to potentially execute unauthorized SQL commands. This issue matters because it could compromise data integrity and system security if an application utilizing this driver is exploited through specially crafted input. At a high level, this could lead to unauthorized data access or modification.

  • Database driver allows remote command execution.
  • Potential for data compromise needs verification.
  • Confirm relevance and assess any potential exposure.

Attack Path

How an attacker could exploit the issue

An attacker could potentially reach this vulnerability by sending a specially crafted Python list as input to an application that uses a vulnerable version of the pg8000 library. If the application processes this input without proper sanitization, the attacker could trick the system into executing arbitrary SQL commands, potentially leading to significant data compromise or system control.

  • No authentication required to reach.
  • Specially crafted Python list input.
  • Arbitrary SQL command execution.

Live Threat

Current exploitation, exposure, and threat context

This SQL injection vulnerability could allow remote attackers to execute arbitrary SQL commands. This could occur when a specially crafted Python list is used as input to a specific function within the affected library.

  • Arbitrary SQL commands could be executed.
  • Specially crafted Python list input.
  • Compromise of database integrity.

Operational Fix

Recommended remediation, mitigation, and detection steps

Application owners are likely responsible for addressing this SQL injection vulnerability in the pg8000 library, as it impacts how their Python applications interact with databases. The first practical step is to identify all applications using this library, confirm their exposure and criticality, and then plan remediation, which may involve coordinating with the vendor or updating application code.

  • Application owners should manage this vulnerability.
  • Verify applications using the library.
  • Plan remediation based on risk.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is the pg8000 library?

pg8000 is a pure-Python database driver used by developers to connect applications to PostgreSQL databases. It facilitates communication between Python code and the database, allowing the application to send queries and receive data results during normal operations.

What does SQL injection mean for CVE-2025-61385?

This vulnerability is classified as CWE-89 (Improper Neutralization of Special Elements used in an SQL Command). It means that when the pg8000 library processes certain inputs incorrectly, it may treat attacker-supplied data as executable database commands, potentially allowing unauthorized access or modification of your database.

How does an attacker trigger this vulnerability?

An attacker triggers this by providing a specially crafted Python list as input to the pg8000.native.literal function. The vulnerability is not triggered if the application does not pass external, unsanitized user input into this specific library function.

Is my application at risk if it uses pg8000?

According to Halo Surface Signal, risk depends on how your developers use the library. Because pg8000 is a backend component, it is not inherently internet-facing. However, if your application takes user input from the internet and passes it to the vulnerable function, it may be reachable.

Do I need to update my code to fix this?

Yes. Start by creating an inventory of all applications in your environment that rely on the pg8000 library. Once identified, verify if those applications pass user-controlled lists to the literal function, then coordinate with your development team to apply necessary security updates or code changes.

References