GHSA-c439-chv8-8g2j
HIGH`os_socketaddr` invalidly assumes the memory layout of std::net::SocketAddr
The os_socketaddr 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.
These layout were changed into idiomatic rust types in nightly std. Starting from rustc 1.64 the affected versions of this crate will have undefined behaviour.
- Published
- 26 Aug 2022
- Last modified
- 8 Nov 2023
- Also known as
- RUSTSEC-2022-0052
- Sources
- OSVJSONOSV RUSTSEC-2022-0052JSON
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | os_socketaddr | < 0.2.2 | 0.2.2 |
| OSV | crates.io | os_socketaddr | >= 0.0.0-0, < 0.2.2 | 0.2.2 |
References
- https://github.com/a-ba/os_socketaddr/issues/3 · WEB, REPORT
- https://github.com/rust-lang/rust/pull/78802 · WEB
- https://github.com/a-ba/os_socketaddr/commit/1bc7f71d40de069727993a18fdada33eb0b4c94f · WEB
- https://github.com/a-ba/os_socketaddr · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2022-0052.html · WEB, ADVISORY
- https://crates.io/crates/os_socketaddr · PACKAGE
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 26 Aug 2022)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 2 Sep 2022)