CVE-2020-35919: Net2 :net::SocketAddr Vulnerability

MODERATE
Advisory Identifier: GHSA-c79c-gwph-gqfm
CVSS 5.5
Published
Advisory Summary

CVE-2020-35919 is a MODERATE (CVSS 5.5) :net::socketaddr vulnerability (General Security Weakness) affecting Net2 libraries in the crates.io ecosystem. The issue involves :net::socketaddr. Remediation is available by upgrading affected packages to version 0.2.36.

CVE-2020-35919 at a Glance

CVE Identifier CVE-2020-35919
GHSA Identifier GHSA-c79c-gwph-gqfm
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification General Security Weakness
Affected Product Net2
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 5.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2020-35919

To remediate this vulnerability, upgrade all affected Net2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

net2 fixed: 0.2.36
Upgrade net2 to 0.2.36
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for net2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-35919, inspect your project dependencies for Net2:

inspect dependencies for net2

Analyze the terminal output to locate any version of Net2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.36), 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 General Security Weakness. In Net2, 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

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.

CVE-2020-35919 Affected Net2 Versions

1 component(s)
Fixed Versions:
0.2.36
Product / Package Ecosystem Affected Versions Fixed Version
net2
crates.io
< 0.2.36
0.2.36

References

Frequently Asked Questions

What is CVE-2020-35919?
CVE-2020-35919 is a security vulnerability in Net2 involving :net::SocketAddr under General Security Weakness.
Which Net2 versions are affected?
Affected versions include releases prior to 0.2.36 across affected packages: net2.
What version fixes CVE-2020-35919?
Upgrading to 0.2.36 (or the latest patched release for your respective branch) resolves the vulnerability.
Is net2 affected?
Yes, net2 is affected in releases prior to 0.2.36. Upgrade your dependency to 0.2.36 or later.
What is the CVSS score of CVE-2020-35919?
CVE-2020-35919 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2020-35919?
CVE-2020-35919 is classified under General Security Weakness.
How can I check crates.io dependencies for CVE-2020-35919?
Run the dependency tree command: 'inspect dependencies for net2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c79c-gwph-gqfm",
  "modified" : "2023-06-14T16:02:27Z",
  "published" : "2022-05-24T17:37:49Z",
  "aliases" : [ "CVE-2020-35919" ],
  "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "net2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.36"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-35919"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/deprecrated/net2-rs/issues/105"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/deprecrated/net2-rs"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2020-0078.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-14T16:02:27Z",
    "nvd_published_at" : "2020-12-31T09:15:00Z"
  }
}