GHSA-g98v-hv3f-hcfr Potential unaligned read
An unmaintained Rust library may cause a crash via unaligned memory access on Windows when using custom allocators.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Not stated
- Victim action needed
- Not needed
- Fix
- None listed
What is GHSA-g98v-hv3f-hcfr?
GHSA-g98v-hv3f-hcfr is a memory corruption vulnerability in atty, published on 4 Jul 2021.
Official description
On windows, atty dereferences a potentially unaligned pointer.
In practice however, the pointer won't be unaligned unless a custom global allocator is used.
In particular, the System allocator on windows uses HeapAlloc, which guarantees a large enough alignment.
atty is Unmaintained
A Pull Request with a fix has been provided over a year ago but the maintainer seems to be unreachable.
Last release of atty was almost 3 years ago.
Possible Alternative(s)
The below list has not been vetted in any way and may or may not contain alternatives;
- std::io::IsTerminal - Stable since Rust 1.70.0
- is-terminal - Standalone crate supporting Rust older than 1.70.0
Which versions are affected by GHSA-g98v-hv3f-hcfr?
3 open source packages ship an affected version, including atty.
| Package | Affected | Fixed in |
|---|---|---|
atty crates.io | All versions to 0.2.14 | None |
atty crates.io | All versions to 0.2.14 | None |
atty crates.io | From 0.0.0-0 | None |
How do I fix GHSA-g98v-hv3f-hcfr?
No fix has been published for GHSA-g98v-hv3f-hcfr yet. Limit exposure of the affected software until one is available.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is GHSA-g98v-hv3f-hcfr being exploited?
There is no known exploitation of GHSA-g98v-hv3f-hcfr in the wild and no public exploit code.
Sources
Also known as RUSTSEC-2021-0145.