# GHSA-c2hm-mjxv-89r4: Multiple soundness issues in lexical

- Severity: Low (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2023-09-03T12:00:00.000Z
- Modified: 2026-02-04T02:37:30.134Z
- Also known as: RUSTSEC-2023-0055
- Related: RUSTSEC-2023-0086

## Description

`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`.

(As written by GitHub Advisory Database.)

## Affected

- lexical (crates.io): before 7.0.0; from 0.0.0-0 before 7.0.0

## References

- <https://github.com/Alexhuszagh/rust-lexical> (package)
- <https://rustsec.org/advisories/RUSTSEC-2023-0055.html> (advisory, web)
- <https://crates.io/crates/lexical> (package)
- <https://github.com/Alexhuszagh/rust-lexical/issues/102> (report)
- <https://github.com/Alexhuszagh/rust-lexical/issues/101> (report)
- <https://github.com/Alexhuszagh/rust-lexical/issues/95> (report)
- <https://github.com/Alexhuszagh/rust-lexical/issues/104> (report)
- <https://github.com/Alexhuszagh/rust-lexical/issues/126> (report)

## Sources

- GitHub Advisory Database: [GHSA-c2hm-mjxv-89r4](https://github.com/advisories/GHSA-c2hm-mjxv-89r4), CC-BY-4.0, modified 2024-09-16
- RustSec Advisory Database: [RUSTSEC-2023-0055](https://rustsec.org/advisories/RUSTSEC-2023-0055.html), CC0-1.0, modified 2026-02-04

---

Page: https://cve.day/GHSA-c2hm-mjxv-89r4 · Whole record: https://cve.day/GHSA-c2hm-mjxv-89r4.json · Rebuilt by cve.day 2026-11-25T22:56:43.153Z
