CVE-2025-64429
JSON

6.9medium

DuckDB Encryption Crypto implementation is vulnerable

Severity
6.9medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.12% (higher than 1% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
PYSEC-2025-112GHSA-vmp8-hg63-v2hp

Description

DuckDB is a SQL database management system. DuckDB implemented block-based encryption of DB on the filesystem starting with DuckDB 1.4.0. There are a few issues related to this implementation. The DuckDB can fall back to an insecure random number generator (pcg32) to generate cryptographic keys or IVs. When clearing keys from memory, the compiler may remove the memset() and leave sensitive data on the heap. By modifying the database header, an attacker could downgrade the encryption mode from GCM to CTR to bypass integrity checks. There may be a failure to check return value on call to OpenSSL `rand_bytes()`. An attacker could use public IVs to compromise the internal state of RNG and determine the randomly generated key used to encrypt temporary files, get access to cryptographic keys if they have access to process memory (e.g. through memory leak),circumvent GCM integrity checks, and/or influence the OpenSSL random number generator and DuckDB would not be able to detect a failure of the generator. Version 1.4.2 has disabled the insecure random number generator by no longer using the fallback to write to or create databases. Instead, DuckDB will now attempt to install and load the OpenSSL implementation in the `httpfs` extension. DuckDB now uses secure MbedTLS primitive to clear memory as recommended and requires explicit specification of ciphers without integrity checks like CTR on `ATTACH`. Additionally, DuckDB now checks the return code.

Affected

Product or packageVersionsReported by
duckdb duckdb>= 1.4.0, < 1.4.2, from 1.4.0 before 1.4.2CVE List, NVD
duckdb (PyPI)from 1.4.0 before 1.4.2PyPA Advisory Database

All scores

GitHub_M6.9medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
PyPA Advisory Database6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Classification

CWE-327

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

DuckDB is a SQL database management system. DuckDB implemented block-based encryption of DB on the filesystem starting with DuckDB 1.4.0. There are a few issues related to this implementation. The DuckDB can fall back to an insecure random number generator (pcg32) to generate cryptographic keys or IVs. When clearing keys from memory, the compiler may remove the memset() and leave sensitive data on the heap. By modifying the database header, an attacker could downgrade the encryption mode from GCM to CTR to bypass integrity checks. There may be a failure to check return value on call to OpenSSL `rand_bytes()`. An attacker could use public IVs to compromise the internal state of RNG and determine the randomly generated key used to encrypt temporary files, get access to cryptographic keys if they have access to process memory (e.g. through memory leak),circumvent GCM integrity checks, and/or influence the OpenSSL random number generator and DuckDB would not be able to detect a failure of the generator. Version 1.4.2 has disabled the insecure random number generator by no longer using the fallback to write to or create databases. Instead, DuckDB will now attempt to install and load the OpenSSL implementation in the `httpfs` extension. DuckDB now uses secure MbedTLS primitive to clear memory as recommended and requires explicit specification of ciphers without integrity checks like CTR on `ATTACH`. Additionally, DuckDB now checks the return code.

NVD (es)

DuckDB es un sistema de gestión de bases de datos SQL. DuckDB implementó el cifrado basado en bloques de la base de datos en el sistema de archivos a partir de DuckDB 1.4.0. Existen algunos problemas relacionados con esta implementación. DuckDB puede recurrir a un generador de números aleatorios inseguro (pcg32) para generar claves criptográficas o IVs. Al borrar claves de la memoria, el compilador puede eliminar memset() y dejar datos sensibles en el heap. Al modificar el encabezado de la base de datos, un atacante podría degradar el modo de cifrado de GCM a CTR para eludir las comprobaciones de integridad. Puede haber un fallo al verificar el valor de retorno en la llamada a OpenSSL rand_bytes(). Un atacante podría usar IVs públicos para comprometer el estado interno del RNG y determinar la clave generada aleatoriamente utilizada para cifrar archivos temporales, obtener acceso a claves criptográficas si tiene acceso a la memoria del proceso (por ejemplo, a través de una fuga de memoria), eludir las comprobaciones de integridad de GCM y/o influir en el generador de números aleatorios de OpenSSL y DuckDB no podría detectar un fallo del generador. La versión 1.4.2 ha deshabilitado el generador de números aleatorios inseguro al dejar de usar el recurso alternativo para escribir o crear bases de datos. En su lugar, DuckDB ahora intentará instalar y cargar la implementación de OpenSSL en la extensión httpfs. DuckDB ahora utiliza la primitiva segura MbedTLS para borrar la memoria según lo recomendado y requiere la especificación explícita de cifrados sin comprobaciones de integridad como CTR en ATTACH. Además, DuckDB ahora verifica el código de retorno.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-64429 changed 2025-11-13CVE Terms of Use
NVDCVE-2025-64429 changed 2026-10-19Public domain
PyPA Advisory DatabasePYSEC-2025-112 changed 2026-05-20CC-BY-4.0