Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. mio
  4. ›
  5. CVE-2020-35922

CVE-2020-35922: mio invalidly assumes the memory layout of std::net::SocketAddr

August 25, 2021 (updated June 13, 2023)

The mio 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.

References

  • github.com/advisories/GHSA-pf3p-x6qj-6j7q
  • github.com/tokio-rs/mio
  • github.com/tokio-rs/mio/commit/152e0751f0be1c9b0cbd6778645b76bcb0eba93c
  • github.com/tokio-rs/mio/issues/1386
  • github.com/tokio-rs/mio/pull/1388
  • nvd.nist.gov/vuln/detail/CVE-2020-35922
  • rustsec.org/advisories/RUSTSEC-2020-0081.html

Code Behaviors & Features

Detect and mitigate CVE-2020-35922 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.7.0 before 0.7.6

Fixed versions

  • 0.7.6

Solution

Upgrade to version 0.7.6 or above.

Impact 5.5 MEDIUM

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-188: Reliance on Data/Memory Layout

Source file

cargo/mio/CVE-2020-35922.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:36 +0000.