Email me

Rust advisories / nftnl

Vulnerability CriticalRUSTSEC-2025-0126 · nftnl

RUSTSEC-2025-0126: Heap-buffer-overflow in nftnl::Batch::with_page_size (nftnl-rs)

Short answerA security vulnerability in the nftnl crate: Heap-buffer-overflow in nftnl::Batch::with_page_size (nftnl-rs). GitHub rates it Critical. Fixed in 0.9.0: update to a fixed version.

Cratenftnl
TypeVulnerability (memory-corruption)
Affected versionsBefore 0.9.0.
Fixed in0.9.0
SeverityCritical (GitHub rating)
Published2025-10-18
Last changed2025-11-27
Also known asGHSA-2fjw-whxm-9v4q

What to do

  1. See which version you have: cargo tree -i nftnl (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p nftnl. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example nftnl = "0.9.0") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

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.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Up next

Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ