GHSA-2fjw-whxm-9v4q: Nftnl :Batch::with_page_size (nftnl-rs) Vulnerability
CRITICALGHSA-2fjw-whxm-9v4q is a CRITICAL :batch::with_page_size (nftnl-rs) vulnerability (CWE-122: Heap-based Buffer Overflow) affecting Nftnl libraries in the crates.io ecosystem. The issue involves :batch::with_page_size (nftnl-rs). Remediation is available by upgrading affected packages to version 0.9.0.
GHSA-2fjw-whxm-9v4q at a Glance
How to Fix GHSA-2fjw-whxm-9v4q
To remediate this vulnerability, upgrade all affected Nftnl dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade nftnl to 0.9.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for nftnl
How to Check if You Are Affected
To determine whether your application is affected by GHSA-2fjw-whxm-9v4q, inspect your project dependencies for Nftnl:
inspect dependencies for nftnl
Analyze the terminal output to locate any version of Nftnl in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.9.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-122: Heap-based Buffer Overflow, where a heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). In Nftnl, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-2fjw-whxm-9v4q Affected Nftnl Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
nftnl
|
crates.io |
< 0.9.0
|
0.9.0
|
References
Frequently Asked Questions
What is GHSA-2fjw-whxm-9v4q?
Which Nftnl versions are affected?
What version fixes GHSA-2fjw-whxm-9v4q?
Is nftnl affected?
What CWE is associated with GHSA-2fjw-whxm-9v4q?
How can I check crates.io dependencies for GHSA-2fjw-whxm-9v4q?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2fjw-whxm-9v4q",
"modified" : "2025-12-01T16:04:47Z",
"published" : "2025-11-25T23:18:37Z",
"aliases" : [ ],
"summary" : "libnftnl has Heap-based 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.\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```",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "nftnl"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.9.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.8.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mullvad/nftnl-rs/issues/76#issue-3528876468"
}, {
"type" : "WEB",
"url" : "https://github.com/mullvad/nftnl-rs/commit/94a286f87e88f431913d19668246de9006790125"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mullvad/nftnl-rs"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2025-0126.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-122" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2025-11-25T23:18:37Z",
"nvd_published_at" : null
}
}