rustsec-2025-0126
Vulnerability from osv_rustsec
Published
2025-10-18 12:00
Modified
2025-11-27 21:53
Summary
Heap-buffer-overflow in nftnl::Batch::with_page_size (nftnl-rs)
Details
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");
Mitigation
Upgrade to version 0.9.0 or later, which aborts instead.
{
"affected": [
{
"database_specific": {
"categories": [
"memory-corruption"
],
"cvss": null,
"informational": null
},
"ecosystem_specific": {
"affected_functions": null,
"affects": {
"arch": [],
"functions": [],
"os": []
}
},
"package": {
"ecosystem": "crates.io",
"name": "nftnl",
"purl": "pkg:cargo/nftnl"
},
"ranges": [
{
"events": [
{
"introduced": "0.0.0-0"
},
{
"fixed": "0.9.0"
}
],
"type": "SEMVER"
}
],
"versions": []
}
],
"aliases": [
"GHSA-2fjw-whxm-9v4q"
],
"database_specific": {
"license": "CC0-1.0"
},
"details": "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.",
"id": "RUSTSEC-2025-0126",
"modified": "2025-11-27T21:53:33Z",
"published": "2025-10-18T12:00:00Z",
"references": [
{
"type": "PACKAGE",
"url": "https://crates.io/crates/nftnl"
},
{
"type": "ADVISORY",
"url": "https://rustsec.org/advisories/RUSTSEC-2025-0126.html"
},
{
"type": "REPORT",
"url": "https://github.com/mullvad/nftnl-rs/issues/76#issue-3528876468"
}
],
"related": [],
"severity": [],
"summary": "Heap-buffer-overflow in nftnl::Batch::with_page_size (nftnl-rs)"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…