{"id":"CVE-2020-35919","aliases":["CVE-2020-35919","GHSA-458v-4hrf-g3m4","GHSA-c79c-gwph-gqfm","RUSTSEC-2020-0078","RUSTSEC-2020-0079"],"related":["CVE-2020-35920"],"kind":"vulnerability","state":"published","title":"socket2 invalidly assumes the memory layout of std::net::SocketAddr","summary":"An issue was discovered in the net2 crate before 0.2.36 for Rust. It has false expectations about the std::net::SocketAddr memory representation.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in the net2 crate before 0.2.36 for Rust. It has false expectations about the std::net::SocketAddr memory representation.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"The net2 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"The [`net2`](https://crates.io/crates/net2) 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.","format":"markdown","source":"rustsec"},{"lang":"en","text":"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.","format":"markdown","source":"rustsec"},{"lang":"es","text":"Se detectó un problema en la crate net2 versiones anteriores a 0.2.36 para Rust.&#xa0;Presenta falsas expectativas sobre la representación de memoria de la función std::net::SocketAddr.","source":"nvd"}],"published":"2020-11-06T12:00:00.000Z","modified":"2026-06-17T03:14:36.360Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:L/AC:L/Au:N/C:N/I:N/A:P","score":2.1,"rating":"LOW"}],"cwes":["CWE-188"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.3.16"}],"ecosystem":"crates.io","package":"socket2","purl":"pkg:cargo/socket2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.2.36"}],"ecosystem":"crates.io","package":"net2","purl":"pkg:cargo/net2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.2.36"}],"ecosystem":"crates.io","package":"net2","purl":"pkg:cargo/net2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.2.36"}],"ecosystem":"crates.io","package":"net2","purl":"pkg:cargo/net2","source":"rustsec"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.3.16"}],"ecosystem":"crates.io","package":"socket2","purl":"pkg:cargo/socket2","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"0.2.36"}],"vendor":"net2_project","product":"net2","cpe":"cpe:2.3:a:net2_project:net2:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2020-0078.html","tags":["advisory","exploit","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-35920","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/deprecrated/net2-rs/issues/105","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/rust-lang/socket2-rs/issues/119","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/rust-lang/socket2-rs","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2020-0079.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-35919","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/deprecrated/net2-rs","tags":["package"],"sources":["ghsa"]},{"url":"https://crates.io/crates/net2","tags":["package"],"sources":["rustsec"]},{"url":"https://crates.io/crates/socket2","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-35919","url":"https://www.cve.org/CVERecord?id=CVE-2020-35919","licence":"CVE Terms of Use","modified":"2024-08-04T17:16:13.180Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-458v-4hrf-g3m4","url":"https://github.com/advisories/GHSA-458v-4hrf-g3m4","licence":"CC-BY-4.0","modified":"2024-02-12T15:55:27.000Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c79c-gwph-gqfm","url":"https://github.com/advisories/GHSA-c79c-gwph-gqfm","licence":"CC-BY-4.0","modified":"2023-11-08T04:03:39.408Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2020-0078","url":"https://rustsec.org/advisories/RUSTSEC-2020-0078.html","licence":"CC0-1.0","modified":"2023-11-08T04:03:39.408Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2020-0079","url":"https://rustsec.org/advisories/RUSTSEC-2020-0079.html","licence":"CC0-1.0","modified":"2024-02-10T15:57:43.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-35919","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-35919","licence":"Public domain","modified":"2026-06-17T03:14:36.360Z"}],"updatedAt":"2026-11-25T22:57:56.655Z","epss":{"score":0.00392,"percentile":0.3541,"date":"2026-12-01T12:00:22.000Z"}}