{"id":"GHSA-2fjw-whxm-9v4q","aliases":["GHSA-2fjw-whxm-9v4q","RUSTSEC-2025-0126"],"related":[],"kind":"vulnerability","state":"published","title":"libnftnl has Heap-based Buffer Overflow in nftnl::Batch::with_page_size (nftnl-rs)","summary":"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.\n\nThe flaw was fixed in commit 94a286f by adding an overflow check:\n```Rust\nbatch_page_size\n    .checked_add(crate::nft_nlmsg_maxsize())\n    .expect(\"batch_page_size is too large and would overflow\");\n```","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"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.\n\nThe flaw was fixed in commit 94a286f by adding an overflow check:\n```Rust\nbatch_page_size\n    .checked_add(crate::nft_nlmsg_maxsize())\n    .expect(\"batch_page_size is too large and would overflow\");\n```","format":"markdown","source":"ghsa"},{"lang":"en","text":"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.\n\nThe flaw was fixed in commit 94a286f by adding an overflow check:\n```Rust\nbatch_page_size\n    .checked_add(crate::nft_nlmsg_maxsize())\n    .expect(\"batch_page_size is too large and would overflow\");\n```\n\n## Mitigation\n\nUpgrade to version `0.9.0` or later, which aborts instead.","format":"markdown","source":"rustsec"}],"published":"2025-10-18T12:00:00.000Z","modified":"2025-12-01T16:20:48.216Z","severity":{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"CRITICAL"}],"cwes":["CWE-122"],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.9.0"}],"ecosystem":"crates.io","package":"nftnl","purl":"pkg:cargo/nftnl","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.9.0"}],"ecosystem":"crates.io","package":"nftnl","purl":"pkg:cargo/nftnl","source":"rustsec"}],"references":[{"url":"https://github.com/mullvad/nftnl-rs/issues/76#issue-3528876468","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/mullvad/nftnl-rs/commit/94a286f87e88f431913d19668246de9006790125","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/mullvad/nftnl-rs","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2025-0126.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/nftnl","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2fjw-whxm-9v4q","url":"https://github.com/advisories/GHSA-2fjw-whxm-9v4q","licence":"CC-BY-4.0","modified":"2025-12-01T16:20:48.216Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2025-0126","url":"https://rustsec.org/advisories/RUSTSEC-2025-0126.html","licence":"CC0-1.0","modified":"2025-11-27T22:04:51.875Z"}],"updatedAt":"2026-11-25T22:56:43.282Z"}