# CVE-2025-64429: DuckDB Encryption Crypto implementation is vulnerable

> Attackers can compromise encryption keys and bypass integrity checks in DuckDB due to insecure random number generation and memory clearing flaws.

- **Severity:** Medium 6.9 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 12 Nov 2025
- **Updated:** 13 Nov 2025
- **Also known as:** GHSA-vmp8-hg63-v2hp, JLSEC-2026-775, PYSEC-2025-112

## What is CVE-2025-64429?

CVE-2025-64429 is a medium-severity vulnerability in duckdb, published on 12 Nov 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-327 (Use of a Broken or Risky Cryptographic Algorithm)

## Which versions are affected by CVE-2025-64429?

1 open source package ship an affected version, including duckdb. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `duckdb` | PyPI | From 1.4.0 | 1.4.2 |

Products: Duckdb Duckdb.

## How do I fix CVE-2025-64429?

Upgrade duckdb to 1.4.2 or later.

## Is CVE-2025-64429 being exploited?

There is no known exploitation of CVE-2025-64429 in the wild and no public exploit code.

## Other vulnerabilities in duckdb

- [CVE-2024-41672](https://insights.sbomify.com/CVE-2024-41672/): DuckDB: sniff_csv provides filesystem access even when enable_external_access is disabled (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-64429 and fix it if it is affected.

What it is: CVE-2025-64429 is a medium-severity vulnerability in duckdb, published on 12 Nov 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-64429 in the wild and no public exploit code.

Affected packages and fixed versions:
- duckdb (PyPI): affected from 1.4.0; fixed in 1.4.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-64429/ (Markdown: https://insights.sbomify.com/CVE-2025-64429/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-64429
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-64429
- OSV: https://osv.dev/vulnerability/CVE-2025-64429

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-64429/
Summaries are generated and may contain mistakes; the official description above is the record.
