
PoC de RCE en PostgreSQL — CVE-2025-8714
PoC de RCE en PostgreSQL — CVE-2025-8714
Este repositorio presenta una prueba de concepto (PoC) para la vulnerabilidad crítica CVE-2025-8714 que afecta a versiones PostgreSQL anteriores a: 17.6, 16.10, 15.14, 14.19, 13.22, y 18 Beta ...
. La vulnerabilidad permite a un atacante con privilegios de superusuario en el servidor de origen inyectar comandos arbitrarios en un dump de base de datos generado con pg_dump o pg_dumpall en formato plano. Estos comandos se ejecutan con los permisos del usuario que restaura el dump usando psql, permitiendo la ejecución remota de código (RCE).
La vulnerabilidad CVE-2025-8714 se encuentra en la forma en que PostgreSQL genera y procesa dumps en formato plano. Un usuario con permisos superusuario puede añadir meta-comandos que se ejecutan al restaurar el dump, lo que puede provocar ejecución arbitraria de comandos en el sistema operativo.
Este PoC demuestra cómo aprovechar esta vulnerabilidad en un entorno Docker con PostgreSQL 14.14 para obtener una shell reversa desde el contenedor víctima hacia el atacante.
poc.sh # Script Bash con PoC automatizado y comentado README.md # Documentación técnica, guía de uso y consideraciones éticas
nc) para abrir el listenergit clone https://github.com/orderby99/CVE-2025-8714-POC.git
cd CVE-2025-8714-POC
Edita poc.sh y reemplaza ATTACKER_IP con la IP de tu máquina atacante (donde abrirás netcat).
En tu máquina atacante, inicia un listener:
nc -lvnp 4444
Ejecuta el PoC:
chmod +x poc.sh ./poc.sh
recibiras una shell reversa desde el contenedor PostgreSQL víctima.
El uso sin autorización en sistemas que no te pertenezcan es ilegal y antiético.
Mitigaciones recomendadas
Actualiza a las versiones parcheadas: PostgreSQL 17.6, 16.10, 15.14, 14.19, 13.22 o superiores.
Evita restaurar dumps en formato plano de fuentes no confiables.
Usa formatos de dump seguros (custom o directory).
Inspecciona dumps antes de restaurar.
MIT License — uso libre para educación e investigación.
Autor: orderby99 Repositorio dedicado a compartir conocimientos prácticos para comprender como funcionan y como protegerse de las nuevas vulnerabiliades.# CVE-2025-8714-POC PostgreSQL RCE PoC — CVE-2025-8714
This repository presents a proof of concept (PoC) for the critical vulnerability CVE-2025-8714 affecting PostgreSQL versions prior to: 17.6, 16.10, 15.14, 14.19, 13.22, and 18 Beta ...
. The vulnerability allows an attacker with superuser privileges on the source server to inject arbitrary commands into a database dump generated with pg_dump or pg_dumpall in plain format. These commands execute with the permissions of the user restoring the dump using psql, enabling remote code execution (RCE).
The CVE-2025-8714 vulnerability lies in how PostgreSQL generates and processes plain-format dumps. A user with superuser privileges can add meta-commands that execute when the dump is restored, potentially leading to arbitrary command execution on the operating system.
This PoC demonstrates how to exploit this vulnerability in a Docker environment with PostgreSQL 14.14 to obtain a reverse shell from the victim container to the attacker.
poc.sh # Automated and commented Bash PoC script README.md # Technical documentation, usage guide, and ethical considerations
nc) to open the listenergit clone https://github.com/orderby99/CVE-2025-8714-POC.git
cd CVE-2025-8714-POC
Edit poc.sh and replace ATTACKER_IP with your attacker machine's IP (where you will open netcat).
On your attacker machine, start a listener:
nc -lvnp 4444
Execute the PoC:
chmod +x poc.sh ./poc.sh
You will receive a reverse shell from the victim PostgreSQL container.
Unauthorized use on systems that do not belong to you is illegal and unethical.
Recommended Mitigations
Update to patched versions: PostgreSQL 17.6, 16.10, 15.14, 14.19, 13.22 or higher.
Avoid restoring plain-format dumps from untrusted sources.
Use secure dump formats (custom or directory).
Inspect dumps before restoring.
MIT License — free use for education and research.
Author: orderby99 Repository dedicated to sharing practical knowledge to understand how new vulnerabilities work and how to protect against them.