GHSA-p5w9-856p-8q4g: Assumed memory layout of std :net::SocketAddr Vulnerability
MODERATEGHSA-p5w9-856p-8q4g is a MODERATE :net::socketaddr vulnerability (CWE-824: Access of Uninitialized Pointer) affecting Assumed memory layout of std libraries in the crates.io ecosystem. The issue involves :net::socketaddr. Remediation is available by upgrading affected packages to version 0.3.16.
GHSA-p5w9-856p-8q4g at a Glance
How to Fix GHSA-p5w9-856p-8q4g
To remediate this vulnerability, upgrade all affected Assumed memory layout of std dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade socket2 to 0.3.16
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for socket2
How to Check if You Are Affected
To determine whether your application is affected by GHSA-p5w9-856p-8q4g, inspect your project dependencies for Assumed memory layout of std:
inspect dependencies for socket2
Analyze the terminal output to locate any version of Assumed memory layout of std in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.16), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-824: Access of Uninitialized Pointer, where the product accesses or uses a pointer that has not been initialized. In Assumed memory layout of std, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-p5w9-856p-8q4g Affected Assumed memory layout of std Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
socket2
|
crates.io |
< 0.3.16
|
0.3.16
|
References
Frequently Asked Questions
What is GHSA-p5w9-856p-8q4g?
Which Assumed memory layout of std versions are affected?
What version fixes GHSA-p5w9-856p-8q4g?
Is socket2 affected?
What CWE is associated with GHSA-p5w9-856p-8q4g?
How can I check crates.io dependencies for GHSA-p5w9-856p-8q4g?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-p5w9-856p-8q4g",
"modified" : "2021-08-24T17:42:08Z",
"published" : "2021-08-25T21:00:23Z",
"withdrawn" : "2021-08-24T17:42:08Z",
"aliases" : [ ],
"summary" : "Assumed memory layout of std::net::SocketAddr",
"details" : "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.\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "socket2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.3.16"
} ]
} ]
} ],
"references" : [ {
"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-0079.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-824" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-08-06T17:25:39Z",
"nvd_published_at" : null
}
}