GHSA-p5w9-856p-8q4g

Suggest an improvement
Source
https://github.com/advisories/GHSA-p5w9-856p-8q4g
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/08/GHSA-p5w9-856p-8q4g/GHSA-p5w9-856p-8q4g.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-p5w9-856p-8q4g
Withdrawn
2021-08-24T17:42:08Z
Published
2021-08-25T21:00:23Z
Modified
2021-08-24T17:42:08Z
Summary
Assumed 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.

Database specific
{
    "cwe_ids":  [
        "CWE-824"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2021-08-06T17:25:39Z",
    "nvd_published_at":  null,
    "severity":  "MODERATE"
}
References

Affected packages

crates.io / socket2

Package

Name
socket2
View open source insights on deps.dev
Purl
pkg:cargo/socket2

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
0.3.16

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/08/GHSA-p5w9-856p-8q4g/GHSA-p5w9-856p-8q4g.json"