GHSA-2fjw-whxm-9v4q libnftnl has Heap-based Buffer Overflow in nftnl::Batch::with_page_size (nftnl-rs)
CriticalCVSS 9.3
- Published
- Updated
- Exploit status
- No public exploit known
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:
batch_page_size
.checked_add(crate::nft_nlmsg_maxsize())
.expect("batch_page_size is too large and would overflow");
Upgrade path
1 package: 1 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| crates.io nftnl(crates.io) | < 0.9.0; <= 0.8.0; >= 0.0.0-0, < 0.9.0 | 0.9.0 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| crates.io nftnl(crates.io) | < 0.9.0 | 0.9.0 |
| crates.io nftnl(crates.io) | >= 0.0.0-0, < 0.9.0 | 0.9.0 |
| crates.io nftnl(crates.io) | <= 0.8.0 | No fix listed |
References
- github.com issue-tracking
- github.com patch
- github.com product
- rustsec.org vendor-advisory
- crates.io product
- github.com