GHSA-c79c-gwph-gqfm

Suggest an improvement
Source
https://github.com/advisories/GHSA-c79c-gwph-gqfm
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/05/GHSA-c79c-gwph-gqfm/GHSA-c79c-gwph-gqfm.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-c79c-gwph-gqfm
Aliases
Published
2022-05-24T17:37:49Z
Modified
2023-11-08T04:03:39.408679Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
`net2` invalidly assumes the memory layout of std::net::SocketAddr
Details

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.

Database specific
{
    "nvd_published_at": "2020-12-31T09:15:00Z",
    "cwe_ids": [],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2023-06-14T16:02:27Z"
}
References

Affected packages

crates.io / net2

Package

Affected ranges

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