GHSA-c2hm-mjxv-89r4: Lexical Multiple Soundness Issues Vulnerability

LOW
Published
Advisory Summary

GHSA-c2hm-mjxv-89r4 is a LOW multiple soundness issues vulnerability (General Security Weakness) affecting Lexical libraries in the crates.io ecosystem. The issue involves multiple soundness issues in lexical. Remediation is available by upgrading affected packages to version 7.0.0.

GHSA-c2hm-mjxv-89r4 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-c2hm-mjxv-89r4
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Lexical
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-c2hm-mjxv-89r4

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

lexical fixed: 7.0.0
Upgrade lexical to 7.0.0
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 lexical

How to Check if You Are Affected

To determine whether your application is affected by GHSA-c2hm-mjxv-89r4, inspect your project dependencies for Lexical:

inspect dependencies for lexical

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

`lexical` contains multiple soundness issues: 1. [Bytes::read() allows creating instances of types with invalid bit patterns](https://github.com/Alexhuszagh/rust-lexical/issues/102) 1. [BytesIter::read() advances iterators out of bounds](https://github.com/Alexhuszagh/rust-lexical/issues/101) 1. [The `BytesIter` trait has safety invariants but is public and not marked `unsafe`](https://github.com/Alexhuszagh/rust-lexical/issues/104) 1. [`write_float()` calls `MaybeUninit::assume_init()` on uninitialized data, which is is not allowed by the Rust abstract machine](https://github.com/Alexhuszagh/rust-lexical/issues/95) 1. [`radix()` calls `MaybeUninit::assume_init()` on uninitialized data, which is is not allowed by the Rust abstract machine](https://github.com/Alexhuszagh/rust-lexical/issues/126) The crate also has some correctness issues. ## Alternatives For quickly parsing floating-point numbers third-party crates are no longer needed. A fast float parsing algorithm by the author of `lexical` has been [merged](https://github.com/rust-lang/rust/pull/86761) into libcore. For quickly parsing integers, consider `atoi` and `btoi` crates (100% safe code). `atoi_radix10` provides even faster parsing, but only with `-C target-cpu=native`, and at the cost of some `unsafe`. For formatting integers in a `#[no_std]` context consider the [`numtoa`](https://crates.io/crates/numtoa) crate. For working with big numbers consider `num-bigint` and `num-traits`.

GHSA-c2hm-mjxv-89r4 Affected Lexical Versions

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

References

Frequently Asked Questions

What is GHSA-c2hm-mjxv-89r4?
GHSA-c2hm-mjxv-89r4 is a security vulnerability in Lexical involving Multiple soundness issues in lexical under General Security Weakness.
Which Lexical versions are affected?
Affected versions include releases prior to 7.0.0 across affected packages: lexical.
What version fixes GHSA-c2hm-mjxv-89r4?
Upgrading to 7.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is lexical affected?
Yes, lexical is affected in releases prior to 7.0.0. Upgrade your dependency to 7.0.0 or later.
What CWE is associated with GHSA-c2hm-mjxv-89r4?
GHSA-c2hm-mjxv-89r4 is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-c2hm-mjxv-89r4?
Run the dependency tree command: 'inspect dependencies for lexical'. 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-c2hm-mjxv-89r4",
  "modified" : "2024-09-16T16:50:14Z",
  "published" : "2023-09-04T17:02:00Z",
  "aliases" : [ ],
  "summary" : "Multiple soundness issues in lexical",
  "details" : "`lexical` contains multiple soundness issues:\n\n 1. [Bytes::read() allows creating instances of types with invalid bit patterns](https://github.com/Alexhuszagh/rust-lexical/issues/102)\n 1. [BytesIter::read() advances iterators out of bounds](https://github.com/Alexhuszagh/rust-lexical/issues/101)\n 1. [The `BytesIter` trait has safety invariants but is public and not marked `unsafe`](https://github.com/Alexhuszagh/rust-lexical/issues/104)\n 1. [`write_float()` calls `MaybeUninit::assume_init()` on uninitialized data, which is is not allowed by the Rust abstract machine](https://github.com/Alexhuszagh/rust-lexical/issues/95)\n1. [`radix()` calls `MaybeUninit::assume_init()` on uninitialized data, which is is not allowed by the Rust abstract machine](https://github.com/Alexhuszagh/rust-lexical/issues/126)\n\nThe crate also has some correctness issues.\n\n## Alternatives\n\nFor quickly parsing floating-point numbers third-party crates are no longer needed. A fast float parsing algorithm by the author of `lexical` has been [merged](https://github.com/rust-lang/rust/pull/86761) into libcore.\n\nFor quickly parsing integers, consider `atoi` and `btoi` crates (100% safe code). `atoi_radix10` provides even faster parsing, but only with `-C target-cpu=native`, and at the cost of some `unsafe`.\n\nFor formatting integers in a `#[no_std]` context consider the [`numtoa`](https://crates.io/crates/numtoa) crate.\n\nFor working with big numbers consider `num-bigint` and `num-traits`.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "lexical"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.0.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.1.1"
    }
  } ],
  "references" : [ {
    "type" : "PACKAGE",
    "url" : "https://github.com/Alexhuszagh/rust-lexical"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2023-0055.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-09-04T17:02:00Z",
    "nvd_published_at" : null
  }
}