CVE-2025-8715
8.8PostgreSQL · PostgreSQL
PostgreSQL pg_dump is vulnerable to CRLF injection, allowing attackers to inject arbitrary code for restore-time execution or achieve SQL injection as a superuser.
Executive summary
A critical vulnerability in PostgreSQL allows attackers to achieve remote code execution and privilege escalation during database restoration processes.
Vulnerability
This vulnerability involves improper neutralization of newline characters within pg_dump, which enables attackers to inject psql meta-commands into object names. This flaw affects the restore process, potentially executing arbitrary code under the context of the client operating system account or performing unauthorized SQL operations as a superuser.
Business impact
The potential for remote code execution on the client system and privilege escalation on the database server presents a severe risk to organizational security. Given the CVSS score of 8.8, this vulnerability is classified as High and could lead to full system compromise, loss of data integrity, and unauthorized administrative access to critical database environments.
Remediation
Immediate Action: Upgrade to the latest patched versions of PostgreSQL (17.6, 16.10, 15.14, 14.19, or 13.22) immediately to remediate the vulnerability.
Proactive Monitoring: Monitor database restoration logs for unusual activity or unexpected commands, and audit the creation of database objects for suspicious characters.
Compensating Controls: Restrict permissions for database object creation to trusted users only and ensure that database backups are only restored in isolated, secure environments.
Exploitation status
Public Exploit Available: No
Analyst recommendation
The severity of this issue, combined with the potential for code execution, necessitates immediate patching of all affected PostgreSQL instances. Administrators should prioritize updating their database infrastructure to the specified non-vulnerable versions to prevent potential exploitation of the restore-time execution vector.
More PostgreSQL CVEs
Sources
Originally found and disclosed by The PostgreSQL project thanks Noah Misch for reporting this problem., per the CVE Program record.