GHSA-jf5h-cf95-w759: Raw cpuid Optional `Deserialize` Implementations Lacking Validation Vulnerability

MODERATE
Published
Advisory Summary

GHSA-jf5h-cf95-w759 is a MODERATE optional `deserialize` implementations lacking validation vulnerability (General Security Weakness) affecting Raw cpuid libraries in the crates.io ecosystem. The issue involves optional `deserialize` implementations lacking validation. Remediation is available by upgrading affected packages to version 9.1.1.

GHSA-jf5h-cf95-w759 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-jf5h-cf95-w759
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Raw cpuid
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-jf5h-cf95-w759

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

raw-cpuid fixed: 9.1.1
Upgrade raw-cpuid to 9.1.1
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 raw-cpuid

How to Check if You Are Affected

To determine whether your application is affected by GHSA-jf5h-cf95-w759, inspect your project dependencies for Raw cpuid:

inspect dependencies for raw-cpuid

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

When activating the non-default feature `serialize`, most structs implement `serde::Deserialize` without sufficient validation. This allows breaking invariants in safe code, leading to: * Undefined behavior in `as_string()` methods (which use `std::str::from_utf8_unchecked()` internally). * Panics due to failed assertions. See https://github.com/gz/rust-cpuid/issues/43.

GHSA-jf5h-cf95-w759 Affected Raw cpuid Versions

1 component(s)
Fixed Versions:
9.1.1
Product / Package Ecosystem Affected Versions Fixed Version
raw-cpuid
crates.io
≥ 3.1.0
< 9.1.1
9.1.1

References

Frequently Asked Questions

What is GHSA-jf5h-cf95-w759?
GHSA-jf5h-cf95-w759 is a security vulnerability in Raw cpuid involving Optional `Deserialize` implementations lacking validation under General Security Weakness.
Which Raw cpuid versions are affected?
Affected versions include releases prior to 9.1.1 across affected packages: raw-cpuid.
What version fixes GHSA-jf5h-cf95-w759?
Upgrading to 9.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is raw-cpuid affected?
Yes, raw-cpuid is affected in releases prior to 9.1.1. Upgrade your dependency to 9.1.1 or later.
What CWE is associated with GHSA-jf5h-cf95-w759?
GHSA-jf5h-cf95-w759 is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-jf5h-cf95-w759?
Run the dependency tree command: 'inspect dependencies for raw-cpuid'. 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-jf5h-cf95-w759",
  "modified" : "2022-06-17T00:16:24Z",
  "published" : "2022-06-17T00:16:24Z",
  "aliases" : [ ],
  "summary" : "Optional `Deserialize` implementations lacking validation",
  "details" : "When activating the non-default feature `serialize`, most structs implement\n`serde::Deserialize` without sufficient validation. This allows breaking\ninvariants in safe code, leading to:\n\n* Undefined behavior in `as_string()` methods (which use\n  `std::str::from_utf8_unchecked()` internally).\n* Panics due to failed assertions.\n\nSee https://github.com/gz/rust-cpuid/issues/43.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "raw-cpuid"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.1.0"
      }, {
        "fixed" : "9.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gz/rust-cpuid/issues/43"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gz/rust-cpuid"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2021-0089.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-17T00:16:24Z",
    "nvd_published_at" : null
  }
}