low
mnl has segmentation fault and invalid memory read in `mnl::cb_run`
- Severity
- low CVSS:4.0 by GitHub
- Published
- Last changed
- Also known as
- RUSTSEC-2025-0142
Description
The function mnl::cb_run is marked as safe but exhibits unsound behavior when processing malformed Netlink message buffers.
Passing a crafted byte slice to mnl::cb_run can trigger memory violations. The function does not sufficiently validate the input buffer structure before processing, leading to out-of-bounds reads.
This vulnerability allows an attacker to cause a Denial of Service (segmentation fault) or potentially read unmapped memory by providing a malformed Netlink message.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| mnl (crates.io) | before 0.3.1, from 0.0.0-0 before 0.3.1 | GitHub Advisory Database, RustSec Advisory Database |
Classification
What each source says
GitHub Advisory Database
The function mnl::cb_run is marked as safe but exhibits unsound behavior when processing malformed Netlink message buffers.
Passing a crafted byte slice to mnl::cb_run can trigger memory violations. The function does not sufficiently validate the input buffer structure before processing, leading to out-of-bounds reads.
This vulnerability allows an attacker to cause a Denial of Service (segmentation fault) or potentially read unmapped memory by providing a malformed Netlink message.
RustSec Advisory Database
The function mnl::cb_run is marked as safe but exhibits unsound behavior when processing malformed Netlink message buffers.
Passing a crafted byte slice to mnl::cb_run can trigger memory violations. The function does not sufficiently validate the input buffer structure before processing, leading to out-of-bounds reads.
This vulnerability allows an attacker to cause a Denial of Service (segmentation fault) or potentially read unmapped memory by providing a malformed Netlink message.
The underlying issue is a bug in libmnl where during validation nlh->nlmsg_len is cast to an int and becomes negative if nlmsg_len is greater than INT_MAX. This causes the validation to succeed even if the buffer is too small for the message. This has been fixed in libmnl but still affects version 1.0.5.
The issue in mnl was fixed in commit cd51bdc by checking the validity of netlink messages passed to mnl::cb_run.
References
Sources
| Source | Record | Licence |
|---|---|---|
| GitHub Advisory Database | GHSA-585q-cm62-757j changed 2026-02-10 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2025-0142 changed 2026-02-10 | CC0-1.0 |