# CVE-2025-34297: KissFFT Integer Overflow Heap Buffer Overflow via kiss_fft_alloc

> An integer overflow in KissFFT's allocation function on 32-bit systems leads to a heap buffer overflow, potentially allowing code execution or crashes.

- **Severity:** High 8.6 (`CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Dec 2025
- **Updated:** 14 Jul 2026
- **Also known as:** DEBIAN-CVE-2025-34297, GHSA-4q9h-j8g6-f49h, UBUNTU-CVE-2025-34297

## What is CVE-2025-34297?

CVE-2025-34297 is a high-severity vulnerability in mborgerding/kissfft, published on 1 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

KissFFT versions prior to the fix commit 1b083165 contain an integer overflow in kiss_fft_alloc() in kiss_fft.c on platforms where size_t is 32-bit. The nfft parameter is not validated before being used in a size calculation (sizeof(kiss_fft_cpx) * (nfft - 1)), which can wrap to a small value when nfft is large. As a result, malloc() allocates an undersized buffer and the subsequent twiddle-factor initialization loop writes nfft elements, causing a heap buffer overflow. This vulnerability only affects 32-bit architectures.

Weakness: CWE-190 (Integer Overflow or Wraparound)

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


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

Apply the vendor's patch.

## Is CVE-2025-34297 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-34297 exists.

## Fix prompt for AI coding agents

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

What it is: CVE-2025-34297 is a high-severity vulnerability in mborgerding/kissfft, published on 1 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-34297 exists.

Affected product: mborgerding/kissfft. No package-level version data is available, so check the vendor advisory linked from the reference page.

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-34297/ (Markdown: https://insights.sbomify.com/CVE-2025-34297/index.md)
```

## Sources

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

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