Unsound HighRUSTSEC-2021-0035 · quinn
RUSTSEC-2021-0035: `quinn` invalidly assumes the memory layout of std::net::SocketAddr
Short answerquinn has an API that can cause undefined behaviour from safe code: `quinn` invalidly assumes the memory layout of std::net::SocketAddr. Fixed in 0.5.4, 0.6.2, 0.7.0.
| Crate | quinn |
|---|---|
| Type | Unsound |
| Affected versions | Before 0.5.4; from 0.6.0 before 0.6.2; from 0.7.0 before 0.7.0. |
| Fixed in | 0.5.4, 0.6.2, 0.7.0 |
| Severity | High, CVSS 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| Published | 2021-03-04 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2021-28036, GHSA-fhv4-fx3v-77w6 |
What to do
- See which version you have:
cargo tree -i quinn(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p quinn. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplequinn = "0.7.0") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
The quinn crate has assumed std::net::SocketAddrV4 and std::net::SocketAddrV6 have the same memory layout as the system C representation sockaddr. It has simply casted the pointers to convert the socket addresses to the system representation. The standard library does not say anything about the memory layout, and this will cause invalid memory access if the standard library changes the implementation. No warnings or errors will be emitted once the change happens.
References
- Package: crates.io/crates/quinn
- Advisory: rustsec.org/advisories/RUSTSEC-2021-0035.html
- Report: github.com/quinn-rs/quinn/issues/968
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
Same cratequinn: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?