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

CVE-2020-35865: os_str_bytes relies on undefined behavior of `char::from_u32_unchecked`

August 25, 2021 (updated June 13, 2023)

The Windows implementation of this crate relied on the behavior of std::char::from_u32_unchecked when its safety clause is violated. Even though this worked with Rust versions up to 1.42 (at least), that behavior could change with any new Rust version, possibly leading a security issue.

The flaw was corrected in version 2.0.0.

References

  • github.com/advisories/GHSA-q948-x8rf-888m
  • github.com/dylni/os_str_bytes
  • github.com/dylni/os_str_bytes/pull/1
  • nvd.nist.gov/vuln/detail/CVE-2020-35865
  • rustsec.org/advisories/RUSTSEC-2020-0012.html

Code Behaviors & Features

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

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 2.0.0

Fixed versions

  • 2.0.0

Solution

Upgrade to version 2.0.0 or above.

Impact 7.5 HIGH

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

Learn more about CVSS

Weakness

  • CWE-704: Incorrect Type Conversion or Cast

Source file

cargo/os_str_bytes/CVE-2020-35865.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sun, 08 Nov 2026 00:16:57 +0000.