Files
advisory-db/packages/stackvector.json
2026-07-02 07:59:37 +00:00

150 lines
4.9 KiB
JSON

[
{
"id": "RUSTSEC-2025-0166",
"modified": "2026-07-02T07:59:25Z",
"published": "2025-10-23T12:00:00Z",
"aliases": [],
"related": [],
"summary": "Multiple soundness issues in `stackvector`",
"details": "Affected versions of `stackvector` contained multiple soundness issues that could allow safe Rust code to trigger undefined behavior.\n\nOne issue was that `StackVec::length` was exposed as a public field. Safe Rust code could set `length` to a value larger than the backing array capacity. Other safe methods, including `remove`, `pop`, and `truncate`, relied on `length` before performing unsafe pointer operations (`ptr::read`, `ptr::copy`, `offset`/`add`). If `length` was corrupted by safe code, these methods could perform out-of-bounds pointer arithmetic, reads, writes, or copies.\n\nThe upstream maintainer also identified additional soundness issues, including the use of `mem::uninitialized` in `StackVec::from_vec_unchecked`, which was reachable through `from_vec`, and Miri violations related to `MaybeUninit` usage.\n\nVersion `2.0.0` was released to fix the known soundness issues.",
"severity": [],
"affected": [
{
"package": {
"ecosystem": "crates.io",
"name": "stackvector",
"purl": "pkg:cargo/stackvector"
},
"ecosystem_specific": {
"affects": {
"arch": [],
"os": [],
"functions": []
},
"affected_functions": null
},
"database_specific": {
"categories": [],
"cvss": null,
"informational": "unsound"
},
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.0.0-0"
},
{
"fixed": "2.0.0"
}
]
}
],
"versions": []
}
],
"references": [
{
"type": "PACKAGE",
"url": "https://crates.io/crates/stackvector"
},
{
"type": "ADVISORY",
"url": "https://rustsec.org/advisories/RUSTSEC-2025-0166.html"
},
{
"type": "REPORT",
"url": "https://github.com/Alexhuszagh/rust-stackvector/issues/3"
},
{
"type": "WEB",
"url": "https://github.com/Alexhuszagh/rust-stackvector/pull/6"
},
{
"type": "WEB",
"url": "https://github.com/Alexhuszagh/rust-stackvector/commit/02b947afdeeb1be95ec0888354aa76afdd9d0357"
},
{
"type": "REPORT",
"url": "https://github.com/Alexhuszagh/rust-stackvector/issues/5"
}
],
"database_specific": {
"license": "CC0-1.0"
}
},
{
"id": "RUSTSEC-2021-0048",
"modified": "2023-06-13T13:10:24Z",
"published": "2021-02-19T12:00:00Z",
"aliases": [
"CVE-2021-29939",
"GHSA-9frf-r7c7-j2vg"
],
"related": [],
"summary": "StackVec::extend can write out of bounds when size_hint is incorrect",
"details": "`StackVec::extend` used the lower and upper bounds from an Iterator's\n`size_hint` to determine how many items to push into the stack based vector.\n\nIf the `size_hint` implementation returned a lower bound that was larger than\nthe upper bound, `StackVec` would write out of bounds and overwrite memory\non the stack. As mentioned by the [size_hint](https://doc.rust-lang.org/std/iter/trait.Iterator.html#provided-methods)\ndocumentation, `size_hint` is mainly for optimization and incorrect\nimplementations should not lead to memory safety issues.",
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
}
],
"affected": [
{
"package": {
"ecosystem": "crates.io",
"name": "stackvector",
"purl": "pkg:cargo/stackvector"
},
"ecosystem_specific": {
"affects": {
"arch": [],
"os": [],
"functions": []
},
"affected_functions": null
},
"database_specific": {
"categories": [
"memory-corruption"
],
"cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L",
"informational": null
},
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.0.0-0"
},
{
"fixed": "1.0.9"
}
]
}
],
"versions": []
}
],
"references": [
{
"type": "PACKAGE",
"url": "https://crates.io/crates/stackvector"
},
{
"type": "ADVISORY",
"url": "https://rustsec.org/advisories/RUSTSEC-2021-0048.html"
},
{
"type": "REPORT",
"url": "https://github.com/Alexhuszagh/rust-stackvector/issues/2"
}
],
"database_specific": {
"license": "CC0-1.0"
}
}
]