{"id":"GHSA-434x-w66g-qw3r","revision":null,"records":[{"revision":"f7372ba2a1214974822e92ecb5b027d7","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-25541","aliases":[],"title":"Bytes is vulnerable to integer overflow in BytesMut::reserve","description":"Bytes is a utility library for working with bytes. From version 1.2.1 to before 1.11.1, Bytes is vulnerable to integer overflow in BytesMut::reserve. In the unique reclaim path of BytesMut::reserve, if the condition \"v_capacity >= new_cap + offset\" uses an unchecked addition. When new_cap + offset overflows usize in release builds, this condition may incorrectly pass, causing self.cap to be set to a value that exceeds the actual allocated capacity. Subsequent APIs such as spare_capacity_mut() then trust this corrupted cap value and may create out-of-bounds slices, leading to UB. This behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks. This issue has been patched in version 1.11.1.","state":0,"publishedAt":"2026-02-04T22:03:53.554+00:00","modifiedAt":"2026-02-05T15:13:34.031+00:00","affected":[{"ecosystem":"Vendor product","name":"bytes","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"tokio-rs\",\n                    \"product\": \"bytes\",\n                    \"versions\": [\n                        {\n                            \"version\": \">= 1.2.1, < 1.11.1\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P","score":5.5,"severity":"MEDIUM"}],"references":["https://github.com/tokio-rs/bytes/security/advisories/GHSA-434x-w66g-qw3r","https://github.com/tokio-rs/bytes/commit/d0293b0e35838123c51ca5dfdf468ecafee4398f","https://github.com/tokio-rs/bytes/releases/tag/v1.11.1","https://rustsec.org/advisories/RUSTSEC-2026-0007.html"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-25541","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-25541","identifiers":["CVE-2026-25541"]},"retained":false,"historicalAffected":[]},{"revision":"70f676122caf46f7a3fd94731cb8ef1c","observedAt":"2026-11-09T06:11:30.44+00:00","statement":{"source":"euvd","id":"EUVD-2026-5321","aliases":["CVE-2026-25541","GHSA-434x-w66g-qw3r"],"title":"Bytes is a utility library for working with bytes. From version 1.2.1 to before 1.11.1, Bytes is vulnerable to integer overflow in BytesMut::reserve. In the unique reclaim path of BytesMut::reserve, if the condition \"v_capacity >= new_cap +…","description":"Bytes is a utility library for working with bytes. From version 1.2.1 to before 1.11.1, Bytes is vulnerable to integer overflow in BytesMut::reserve. In the unique reclaim path of BytesMut::reserve, if the condition \"v_capacity >= new_cap + offset\" uses an unchecked addition. When new_cap + offset overflows usize in release builds, this condition may incorrectly pass, causing self.cap to be set to a value that exceeds the actual allocated capacity. Subsequent APIs such as spare_capacity_mut() then trust this corrupted cap value and may create out-of-bounds slices, leading to UB. This behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks. This issue has been patched in version 1.11.1.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P","score":5.5,"severity":null}],"references":["https://github.com/tokio-rs/bytes/security/advisories/GHSA-434x-w66g-qw3r","https://github.com/tokio-rs/bytes/commit/d0293b0e35838123c51ca5dfdf468ecafee4398f","https://github.com/tokio-rs/bytes/releases/tag/v1.11.1","https://rustsec.org/advisories/RUSTSEC-2026-0007.html"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-5321","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Feb 4, 2026, 10:03:53 PM","dateUpdated":"Feb 5, 2026, 3:13:34 PM"},"relatedAdvisories":[{"id":"openSUSE-SU-2026:12205-1","title":"switcheroo-2.6.0-1.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:21794-1","title":"Security update for supergfxctl","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:11838-1","title":"pijul-1.0.0~beta.23-1.1 on GA media","vulnerabilityIds":["CVE-2022-50237","CVE-2025-3416","CVE-2026-25541"]},{"id":"SUSE-SU-2026:22935-1","title":"Security update for nm-configurator","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:21782-1","title":"Security update for aws-nitro-enclaves-cli","vulnerabilityIds":["CVE-2026-25541","CVE-2026-25727","CVE-2026-41676"]},{"id":"openSUSE-SU-2026:11495-1","title":"git-cliff-2.13.1-1.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"SUSE-SU-2026:23643-1","title":"Security update for aws-nitro-enclaves-cli","vulnerabilityIds":["CVE-2026-25541","CVE-2026-25727","CVE-2026-41676"]},{"id":"SUSE-SU-2026:24236-1","title":"Security update for agama","vulnerabilityIds":["CVE-2025-58160","CVE-2026-25541"]},{"id":"openSUSE-SU-2026:11656-1","title":"aws-nitro-enclaves-binaryblobs-upstream-1.5.0~git0.2950b36-1.1 on GA media","vulnerabilityIds":["CVE-2026-25541","CVE-2026-25727"]},{"id":"openSUSE-SU-2026:11522-1","title":"obs-service-cargo-7.2.2-2.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:11905-1","title":"tealdeer-1.8.0-2.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:11549-1","title":"markdown-oxide-0.25.12-1.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:11492-1","title":"aws-efs-utils-3.2.0-1.1 on GA media","vulnerabilityIds":["CVE-2026-16317","CVE-2026-16318","CVE-2026-25541"]},{"id":"openSUSE-SU-2026:21558-1","title":"Security update for gitoxide","vulnerabilityIds":["CVE-2024-32650","CVE-2025-22620","CVE-2025-31130","CVE-2026-25541","CVE-2026-40034"]},{"id":"SUSE-SU-2026:2977-1","title":"Security update for afterburn","vulnerabilityIds":["CVE-2026-25541","CVE-2026-41676","CVE-2026-41677","CVE-2026-41678","CVE-2026-41681","CVE-2026-41898","CVE-2026-42327","CVE-2026-44662","CVE-2026-45784"]},{"id":"SUSE-SU-2026:22787-1","title":"Security update for afterburn","vulnerabilityIds":["CVE-2026-25541","CVE-2026-41676","CVE-2026-41677","CVE-2026-41678","CVE-2026-41681","CVE-2026-41898","CVE-2026-42327","CVE-2026-44662","CVE-2026-45784"]},{"id":"SUSE-SU-2026:23659-1","title":"Security update for aws-nitro-enclaves-cli","vulnerabilityIds":["CVE-2026-25541","CVE-2026-25727","CVE-2026-41676"]},{"id":"openSUSE-SU-2026:21428-1","title":"Security update for nm-configurator","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:11280-1","title":"nm-configurator-0.3.5-2.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:21560-1","title":"Security update for kak-lsp","vulnerabilityIds":["CVE-2025-3416","CVE-2025-55159","CVE-2026-25541"]},{"id":"SUSE-SU-2026:23071-1","title":"Security update for afterburn","vulnerabilityIds":["CVE-2022-24713","CVE-2024-12224","CVE-2025-3416","CVE-2025-5791","CVE-2026-25541","CVE-2026-41676","CVE-2026-41677","CVE-2026-41678","CVE-2026-41681","CVE-2026-41898","CVE-2026-42327","CVE-2026-44662","CVE-2026-45784"]},{"id":"openSUSE-SU-2026:11525-1","title":"rustup-1.29.0~0-1.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:11475-1","title":"kak-lsp-21.0.2-1.1 on GA media","vulnerabilityIds":["CVE-2025-3416","CVE-2025-55159","CVE-2026-25541"]},{"id":"openSUSE-SU-2026:22075-1","title":"Security update for agama","vulnerabilityIds":["CVE-2025-58160","CVE-2026-25541"]},{"id":"openSUSE-SU-2026:11513-1","title":"cargo-c-0.10.23-2.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"SUSE-SU-2026:22917-1","title":"Security update for afterburn","vulnerabilityIds":["CVE-2022-24713","CVE-2024-12224","CVE-2025-3416","CVE-2025-5791","CVE-2026-25541","CVE-2026-41676","CVE-2026-41677","CVE-2026-41678","CVE-2026-41681","CVE-2026-41898","CVE-2026-42327","CVE-2026-44662","CVE-2026-45784"]},{"id":"openSUSE-SU-2026:11512-1","title":"cargo-audit-0.22.2~git0.281452c-2.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"SUSE-SU-2026:23572-1","title":"Security update for gstreamer-devtools","vulnerabilityIds":["CVE-2025-4574","CVE-2025-58160","CVE-2026-25541","CVE-2026-25727","CVE-2026-72813","CVE-2026-72814"]},{"id":"openSUSE-SU-2026:11528-1","title":"wasm-bindgen-0.2.100-2.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:11679-1","title":"agama-24+0.a836cced5-54.1 on GA media","vulnerabilityIds":["CVE-2025-58160","CVE-2026-25541"]},{"id":"openSUSE-SU-2026:11818-1","title":"shadowsocks-rust-1.25.0-1.1 on GA media","vulnerabilityIds":["CVE-2025-3416","CVE-2026-25541"]},{"id":"openSUSE-SU-2026:21584-1","title":"Security update for git-cliff","vulnerabilityIds":["CVE-2025-55159","CVE-2026-25541"]},{"id":"openSUSE-SU-2026:22189-1","title":"Security update for shadowsocks-rust, shadowsocks-libev","vulnerabilityIds":["CVE-2025-3416","CVE-2026-25541","CVE-2026-93599","CVE-2026-93600","CVE-2026-93601","CVE-2026-93602"]},{"id":"openSUSE-SU-2026:11529-1","title":"forgejo-cli-0.6.0-2.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"SUSE-SU-2026:2976-1","title":"Security update for afterburn","vulnerabilityIds":["CVE-2026-25541","CVE-2026-41676","CVE-2026-41677","CVE-2026-41678","CVE-2026-41681","CVE-2026-41898","CVE-2026-42327","CVE-2026-44662","CVE-2026-45784"]},{"id":"openSUSE-SU-2026:21815-1","title":"Security update for waylyrics","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:11482-1","title":"wild-0.10.0-2.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:21386-1","title":"Security update for afterburn","vulnerabilityIds":["CVE-2026-25541","CVE-2026-41676","CVE-2026-41677","CVE-2026-41678","CVE-2026-41681","CVE-2026-41898","CVE-2026-42327","CVE-2026-44662","CVE-2026-45784"]},{"id":"openSUSE-SU-2026:11474-1","title":"gitoxide-0.56.0-1.1 on GA media","vulnerabilityIds":["CVE-2026-25541","CVE-2026-40034"]},{"id":"openSUSE-SU-2026:22016-1","title":"Security update for rustup","vulnerabilityIds":["CVE-2024-12224","CVE-2025-58160","CVE-2026-25541","CVE-2026-25727","CVE-2026-41676","CVE-2026-41677","CVE-2026-41678","CVE-2026-41681","CVE-2026-41898","CVE-2026-42327","CVE-2026-44662","CVE-2026-45784","CVE-2026-93599","CVE-2026-93600","CVE-2026-93601","CVE-2026-93602"]},{"id":"openSUSE-SU-2026:11255-1","title":"afterburn-5.10.0.git73.b97f772-1.1 on GA media","vulnerabilityIds":["CVE-2026-25541","CVE-2026-41676","CVE-2026-41677","CVE-2026-41898","CVE-2026-42327","CVE-2026-45784"]},{"id":"SUSE-SU-2026:2975-1","title":"Security update for afterburn","vulnerabilityIds":["CVE-2026-25541","CVE-2026-41676","CVE-2026-41677","CVE-2026-41678","CVE-2026-41681","CVE-2026-41898","CVE-2026-42327","CVE-2026-44662","CVE-2026-45784"]},{"id":"msrc_CVE-2026-25541","title":"Bytes is vulnerable to integer overflow in BytesMut::reserve","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:21982-1","title":"Security update for sccache","vulnerabilityIds":["CVE-2024-12224","CVE-2026-25541","CVE-2026-25727","CVE-2026-41676","CVE-2026-41677","CVE-2026-41678","CVE-2026-41681","CVE-2026-41898","CVE-2026-42327","CVE-2026-44662","CVE-2026-45784","CVE-2026-66746","CVE-2026-66754","CVE-2026-67181","CVE-2026-67182","CVE-2026-93599","CVE-2026-93600","CVE-2026-93601","CVE-2026-93602"]},{"id":"openSUSE-SU-2026:21689-1","title":"Security update for gstreamer-devtools","vulnerabilityIds":["CVE-2025-4574","CVE-2025-58160","CVE-2026-25541","CVE-2026-25727","CVE-2026-72813","CVE-2026-72814"]},{"id":"openSUSE-SU-2026:11835-1","title":"librepods-0.1.0+git20260515.672e65a-1.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"openSUSE-SU-2026:11527-1","title":"sccache-0.17.0~1-2.1 on GA media","vulnerabilityIds":["CVE-2026-25541","CVE-2026-66746","CVE-2026-66754","CVE-2026-67181","CVE-2026-67182"]},{"id":"openSUSE-RU-2026:21658-1","title":"Recommended update for sequoia-sq","vulnerabilityIds":["CVE-2026-25541"]},{"id":"SUSE-SU-2026:23983-1","title":"Security update for sccache","vulnerabilityIds":["CVE-2024-12224","CVE-2026-25541","CVE-2026-25727","CVE-2026-41676","CVE-2026-41677","CVE-2026-41678","CVE-2026-41681","CVE-2026-41898","CVE-2026-42327","CVE-2026-44662","CVE-2026-45784","CVE-2026-66746","CVE-2026-66754","CVE-2026-67181","CVE-2026-67182","CVE-2026-93599","CVE-2026-93600","CVE-2026-93601","CVE-2026-93602"]},{"id":"SUSE-SU-2026:24014-1","title":"Security update for rustup","vulnerabilityIds":["CVE-2024-12224","CVE-2025-58160","CVE-2026-25541","CVE-2026-25727","CVE-2026-41676","CVE-2026-41677","CVE-2026-41678","CVE-2026-41681","CVE-2026-41898","CVE-2026-42327","CVE-2026-44662","CVE-2026-45784","CVE-2026-93599","CVE-2026-93600","CVE-2026-93601","CVE-2026-93602"]},{"id":"openSUSE-SU-2026:21605-1","title":"Security update for forgejo-cli","vulnerabilityIds":["CVE-2025-3416","CVE-2025-55159","CVE-2026-25541"]},{"id":"openSUSE-SU-2026:11655-1","title":"libtree-sitter0_26-0.26.8-5.1 on GA media","vulnerabilityIds":["CVE-2026-25541"]},{"id":"SUSE-SU-2026:22827-1","title":"Security update for afterburn","vulnerabilityIds":["CVE-2026-25541","CVE-2026-41676","CVE-2026-41677","CVE-2026-41678","CVE-2026-41681","CVE-2026-41898","CVE-2026-42327","CVE-2026-44662","CVE-2026-45784"]}],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-5321","identifiers":["EUVD-2026-5321","CVE-2026-25541","GHSA-434x-w66g-qw3r"]},"retained":false,"historicalAffected":[]},{"revision":"a0858f8bc28b464cb9bc0e0b4f01ad4b","observedAt":"2026-10-25T06:17:16.233+00:00","statement":{"source":"nvd","id":"CVE-2026-25541","aliases":[],"title":"Bytes is a utility library for working with bytes. From version 1.2.1 to before 1.11.1, Bytes is vulnerable to integer overflow in BytesMut::reserve. In the unique reclaim path of BytesMut::reserve, if the condition \"v_capacity >= new_cap +…","description":"Bytes is a utility library for working with bytes. From version 1.2.1 to before 1.11.1, Bytes is vulnerable to integer overflow in BytesMut::reserve. In the unique reclaim path of BytesMut::reserve, if the condition \"v_capacity >= new_cap + offset\" uses an unchecked addition. When new_cap + offset overflows usize in release builds, this condition may incorrectly pass, causing self.cap to be set to a value that exceeds the actual allocated capacity. Subsequent APIs such as spare_capacity_mut() then trust this corrupted cap value and may create out-of-bounds slices, leading to UB. This behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks. This issue has been patched in version 1.11.1.","state":0,"publishedAt":"2026-02-04T22:16:00.383+00:00","modifiedAt":"2026-06-17T10:24:49.41+00:00","affected":[],"metrics":[{"system":"CVSS 4.0 · security-advisories@github.com · Secondary","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","score":5.5,"severity":"MEDIUM"},{"system":"CVSS 3.1 · nvd@nist.gov · Primary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"severity":"HIGH"}],"references":["https://github.com/tokio-rs/bytes/commit/d0293b0e35838123c51ca5dfdf468ecafee4398f","https://github.com/tokio-rs/bytes/releases/tag/v1.11.1","https://github.com/tokio-rs/bytes/security/advisories/GHSA-434x-w66g-qw3r","https://rustsec.org/advisories/RUSTSEC-2026-0007.html"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-25541","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Analyzed","weaknesses":["CWE-680"],"productCriteria":["cpe:2.3:a:tokio-rs:bytes:*:*:*:*:*:rust:*:*"],"sourceDates":{"published":"2026-02-04T22:16:00.383","lastModified":"2026-06-17T10:24:49.410"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-25541","identifiers":["CVE-2026-25541"]},"retained":false,"historicalAffected":[]},{"revision":"7618d33377094dd18083c368555a7ad0","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"GHSA-434x-w66g-qw3r","aliases":["CVE-2026-25541","RUSTSEC-2026-0007"],"title":"bytes has integer overflow in BytesMut::reserve","description":"# Details\n\nIn the unique reclaim path of `BytesMut::reserve`, the condition\n```rs\nif v_capacity >= new_cap + offset\n```\nuses an unchecked addition. When `new_cap + offset` overflows `usize` in release builds, this condition may incorrectly pass, causing `self.cap` to be set to a value that exceeds the actual allocated capacity. Subsequent APIs such as `spare_capacity_mut()` then trust this corrupted `cap` value and may create out-of-bounds slices, leading to UB.\n\nThis behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks.\n\n## PoC\n\n```rs\nuse bytes::*;\n\nfn main() {\n    let mut a = BytesMut::from(&b\"hello world\"[..]);\n    let mut b = a.split_off(5);\n\n    // Ensure b becomes the unique owner of the backing storage\n    drop(a);\n\n    // Trigger overflow in new_cap + offset inside reserve\n    b.reserve(usize::MAX - 6);\n\n    // This call relies on the corrupted cap and may cause UB & HBO\n    b.put_u8(b'h');\n}\n```\n\n# Workarounds\n\nUsers of `BytesMut::reserve` are only affected if integer overflow checks are configured to wrap. When integer overflow is configured to panic, this issue does not apply.\n\nThis vulnerability is also known as [RUSTSEC-2026-0007](https://rustsec.org/advisories/RUSTSEC-2026-0007.html).","state":0,"publishedAt":"2026-02-03T19:17:46+00:00","modifiedAt":"2026-09-10T03:50:33.9958414+00:00","affected":[{"ecosystem":"crates.io","name":"bytes","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"1.2.1"},{"kind":"fixed","version":"1.11.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/tokio-rs/bytes/security/advisories/GHSA-434x-w66g-qw3r","https://nvd.nist.gov/vuln/detail/CVE-2026-25541","https://github.com/tokio-rs/bytes/commit/d0293b0e35838123c51ca5dfdf468ecafee4398f","https://github.com/tokio-rs/bytes","https://github.com/tokio-rs/bytes/releases/tag/v1.11.1","https://rustsec.org/advisories/RUSTSEC-2026-0007.html"],"sourceUrl":"https://github.com/advisories/GHSA-434x-w66g-qw3r","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-434x-w66g-qw3r","identifiers":["GHSA-434x-w66g-qw3r","CVE-2026-25541","RUSTSEC-2026-0007"]},"retained":false,"historicalAffected":[]},{"revision":"b6c44e7847034b2ba16815614f3c7547","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"RUSTSEC-2026-0007","aliases":["CVE-2026-25541","GHSA-434x-w66g-qw3r"],"title":"Integer overflow in `BytesMut::reserve`","description":"In the unique reclaim path of `BytesMut::reserve`, the condition\n```rs\nif v_capacity >= new_cap + offset\n```\nuses an unchecked addition. When `new_cap + offset` overflows `usize` in release builds, this condition may incorrectly pass, causing `self.cap` to be set to a value that exceeds the actual allocated capacity. Subsequent APIs such as `spare_capacity_mut()` then trust this corrupted `cap` value and may create out-of-bounds slices, leading to UB.\n\nThis behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks.\n\n## PoC\n\n```rs\nuse bytes::*;\n\nfn main() {\n    let mut a = BytesMut::from(&b\"hello world\"[..]);\n    let mut b = a.split_off(5);\n\n    // Ensure b becomes the unique owner of the backing storage\n    drop(a);\n\n    // Trigger overflow in new_cap + offset inside reserve\n    b.reserve(usize::MAX - 6);\n\n    // This call relies on the corrupted cap and may cause UB & HBO\n    b.put_u8(b'h');\n}\n```\n\n# Workarounds\n\nUsers of `BytesMut::reserve` are only affected if integer overflow checks are configured to wrap. When integer overflow is configured to panic, this issue does not apply.","state":0,"publishedAt":"2026-02-03T12:00:00+00:00","modifiedAt":"2026-10-12T18:00:09.239419+00:00","affected":[{"ecosystem":"crates.io","name":"bytes","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"1.2.1"},{"kind":"fixed","version":"1.11.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://crates.io/crates/bytes","https://rustsec.org/advisories/RUSTSEC-2026-0007.html","https://github.com/tokio-rs/bytes/commit/d0293b0e35838123c51ca5dfdf468ecafee4398f"],"sourceUrl":"https://osv.dev/vulnerability/RUSTSEC-2026-0007","license":"OSV · upstream source license applies","key":"osv:RUSTSEC-2026-0007","identifiers":["RUSTSEC-2026-0007","CVE-2026-25541","GHSA-434x-w66g-qw3r"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-10T10:21:23.1769119+00:00","complete":true,"records":1773,"lastAttemptAt":"2026-11-10T10:21:23.1769119+00:00","lastSuccessAt":"2026-11-10T10:21:23.4268898+00:00","error":null,"lastVerifiedAt":"2026-11-10T10:21:23.4268987+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-8859cf40d4337e24bd2f258cc7778fbad01bb24c79d057aaf34cf1dfc6f8917d-8bdcdeeb414e06ff50ed637d818ac25d52680d19f71fc0ebe3f4c4b3f836ed38","complete":true,"records":421927,"lastAttemptAt":"2026-11-10T10:21:22.8157744+00:00","lastSuccessAt":"2026-11-10T09:21:38.1064889+00:00","error":null,"lastVerifiedAt":"2026-11-10T10:21:22.8157744+00:00","snapshotPublishedAt":"2026-11-10T09:20:43+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-2e6a476534094233b48f2f0b6da5cf35","complete":true,"records":13689,"lastAttemptAt":"2026-11-10T10:21:50.2500014+00:00","lastSuccessAt":"2026-11-10T06:05:35.03+00:00","error":null,"lastVerifiedAt":"2026-11-10T06:05:35.03+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13742,"expectedIdentifiers":13742,"failedIdentifiers":0},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-10T10:21:23.1769119+00:00","complete":true,"records":1096,"lastAttemptAt":"2026-11-10T10:21:23.1769119+00:00","lastSuccessAt":"2026-11-10T10:21:23.4276529+00:00","error":null,"lastVerifiedAt":"2026-11-10T10:21:23.4276532+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-b0b0499af228434598651aa5d221386e","complete":false,"records":13695,"lastAttemptAt":"2026-11-10T10:21:49.6403901+00:00","lastSuccessAt":"2026-11-10T10:21:49.637+00:00","error":"100 identifier lookups failed; latest failures include request timeout. Other identifiers were checked independently.","lastVerifiedAt":"2026-11-10T10:21:49.637+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13642,"expectedIdentifiers":13742,"failedIdentifiers":100},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-cdffb4589856378aa42e8d1bd4a6c74e27a180d8160bf764c44715ef760f0a62","complete":true,"records":9932,"lastAttemptAt":"2026-11-10T10:21:23.1241572+00:00","lastSuccessAt":"2026-11-10T00:04:19.8260565+00:00","error":null,"lastVerifiedAt":"2026-11-10T10:21:23.1241572+00:00","snapshotPublishedAt":"2026-11-09T23:48:01+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-26503967ae4379db8f374089589d6e03fb15bd31f820c9e992aaf93840c2236c","complete":true,"records":1971,"lastAttemptAt":"2026-11-10T10:21:22.8858542+00:00","lastSuccessAt":"2026-11-09T21:02:20.472473+00:00","error":null,"lastVerifiedAt":"2026-11-10T10:21:22.8858542+00:00","snapshotPublishedAt":"2026-11-09T20:18:18+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-94169eec81ea3989aa551092397ff34ae53c104b4a6ce646e1524452e4ab2a39","complete":true,"records":3065,"lastAttemptAt":"2026-11-10T10:21:23.1397622+00:00","lastSuccessAt":"2026-11-10T08:04:45.5923716+00:00","error":null,"lastVerifiedAt":"2026-11-10T10:21:23.1397622+00:00","snapshotPublishedAt":"2026-11-10T06:48:01+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-4331051b0b2d4ccdbdca3aa196b0be3818a465064a4b18dde4cf39c2250eb490","complete":true,"records":231599,"lastAttemptAt":"2026-11-10T10:21:23.0142877+00:00","lastSuccessAt":"2026-11-10T08:04:37.1757322+00:00","error":null,"lastVerifiedAt":"2026-11-10T10:21:23.0142877+00:00","snapshotPublishedAt":"2026-11-10T07:33:02+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}