{"ecosystem":"cargo","package":"socket2","version":null,"bugs":[{"id":827,"ecosystem":"cargo","package_name":"socket2","affected_version":"0.0.0-0","fixed_version":"0.3.16","bug_id":"osv:RUSTSEC-2020-0079","title":"`socket2` invalidly assumes the memory layout of std::net::SocketAddr","description":"The [`socket2`](https://crates.io/crates/socket2) crate has assumed `std::net::SocketAddrV4`\nand `std::net::SocketAddrV6` have the same memory layout as the system C representation\n`sockaddr`. It has simply casted the pointers to convert the socket addresses to the\nsystem representation. The standard library does not say anything about the memory\nlayout, and this will cause invalid memory access if the standard library\nchanges the implementation. No warnings or errors will be emitted once the\nchange happens.","severity":"medium","status":"fixed","source":"osv","source_url":"https://crates.io/crates/socket2","labels":["CVE-2020-35919","CVE-2020-35920","GHSA-458v-4hrf-g3m4","GHSA-c79c-gwph-gqfm","RUSTSEC-2020-0078"],"created_at":"2026-04-19 04:31:57.719763+00:00","updated_at":"2026-04-19 04:31:57.719763+00:00"},{"id":826,"ecosystem":"cargo","package_name":"socket2","affected_version":null,"fixed_version":"0.3.16","bug_id":"osv:GHSA-458v-4hrf-g3m4","title":"socket2 invalidly assumes the memory layout of std::net::SocketAddr","description":"The socket2 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.\n","severity":"medium","status":"fixed","source":"osv","source_url":"https://nvd.nist.gov/vuln/detail/CVE-2020-35920","labels":["CVE-2020-35919","CVE-2020-35920","GHSA-c79c-gwph-gqfm","RUSTSEC-2020-0078","RUSTSEC-2020-0079"],"created_at":"2026-04-19 04:31:57.718661+00:00","updated_at":"2026-04-19 04:31:57.718661+00:00"}],"total":2,"_cache":"hit"}