GHSA-458V-4HRF-G3M4
Vulnerability from github – Published: 2021-08-25 20:50 – Updated: 2024-02-12 15:55
VLAI?
Summary
socket2 invalidly assumes the memory layout of std::net::SocketAddr
Details
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.
Severity ?
5.5 (Medium)
{
"affected": [
{
"package": {
"ecosystem": "crates.io",
"name": "socket2"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.3.16"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "crates.io",
"name": "net2"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.2.36"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2020-35920"
],
"database_specific": {
"cwe_ids": [
"CWE-188"
],
"github_reviewed": true,
"github_reviewed_at": "2021-08-19T18:53:58Z",
"nvd_published_at": "2020-12-31T09:15:16Z",
"severity": "MODERATE"
},
"details": "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",
"id": "GHSA-458v-4hrf-g3m4",
"modified": "2024-02-12T15:55:27Z",
"published": "2021-08-25T20:50:37Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-35920"
},
{
"type": "WEB",
"url": "https://github.com/deprecrated/net2-rs/issues/105"
},
{
"type": "WEB",
"url": "https://github.com/rust-lang/socket2-rs/issues/119"
},
{
"type": "PACKAGE",
"url": "https://github.com/rust-lang/socket2-rs"
},
{
"type": "WEB",
"url": "https://rustsec.org/advisories/RUSTSEC-2020-0078.html"
},
{
"type": "WEB",
"url": "https://rustsec.org/advisories/RUSTSEC-2020-0079.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
],
"summary": "socket2 invalidly assumes the memory layout of std::net::SocketAddr"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…