# GHSA-2fjw-whxm-9v4q: libnftnl has Heap-based Buffer Overflow in nftnl::Batch::with_page_size (nftnl-rs)

- Severity: Critical (CVSS:4.0, scored by GitHub) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:L/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2025-10-18T12:00:00.000Z
- Modified: 2025-12-01T16:20:48.216Z
- Also known as: RUSTSEC-2025-0126
- Weaknesses: CWE-122

## Description

A heap-buffer-overflow vulnerability exists in the Rust wrapper for libnftnl, triggered via the nftnl::Batch::with_page_size constructor. When a small or malformed page size is provided, the underlying C code allocates an insufficient buffer, leading to out-of-bounds writes during batch initialization.

The flaw was fixed in commit 94a286f by adding an overflow check:
```Rust
batch_page_size
    .checked_add(crate::nft_nlmsg_maxsize())
    .expect("batch_page_size is too large and would overflow");
```

(As written by GitHub Advisory Database.)

## Affected

- nftnl (crates.io): before 0.9.0; from 0.0.0-0 before 0.9.0

## References

- <https://github.com/mullvad/nftnl-rs/issues/76#issue-3528876468> (report, web)
- <https://github.com/mullvad/nftnl-rs/commit/94a286f87e88f431913d19668246de9006790125> (web)
- <https://github.com/mullvad/nftnl-rs> (package)
- <https://rustsec.org/advisories/RUSTSEC-2025-0126.html> (advisory, web)
- <https://crates.io/crates/nftnl> (package)

## Sources

- GitHub Advisory Database: [GHSA-2fjw-whxm-9v4q](https://github.com/advisories/GHSA-2fjw-whxm-9v4q), CC-BY-4.0, modified 2025-12-01
- RustSec Advisory Database: [RUSTSEC-2025-0126](https://rustsec.org/advisories/RUSTSEC-2025-0126.html), CC0-1.0, modified 2025-11-27

---

Page: https://cve.day/GHSA-2fjw-whxm-9v4q · Whole record: https://cve.day/GHSA-2fjw-whxm-9v4q.json · Rebuilt by cve.day 2026-11-25T22:56:43.282Z
