RUSTSEC-2025-0126
CRITICALlibnftnl has Heap-based Buffer Overflow in nftnl::Batch::with_page_size (nftnl-rs)
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:
batch_page_size
.checked_add(crate::nft_nlmsg_maxsize())
.expect("batch_page_size is too large and would overflow");
- Published
- 18 Oct 2025
- Last modified
- 1 Dec 2025
- Weakness
- CWE-122
- Also known as
- GHSA-2fjw-whxm-9v4q
- Sources
- OSV GHSA-2fjw-whxm-9v4qJSONOSVJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | 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 |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | nftnl | < 0.9.0 | 0.9.0 |
| OSV | crates.io | nftnl | >= 0.0.0-0, < 0.9.0 | 0.9.0 |
References
- https://github.com/mullvad/nftnl-rs/issues/76#issue-3528876468 · WEB, REPORT
- https://github.com/mullvad/nftnl-rs/commit/94a286f87e88f431913d19668246de9006790125 · WEB
- https://github.com/mullvad/nftnl-rs · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2025-0126.html · WEB, ADVISORY
- https://crates.io/crates/nftnl · PACKAGE
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 18 Oct 2025)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 25 Nov 2025)