Unsound LowRUSTSEC-2021-0145 · atty
RUSTSEC-2021-0145: Potential unaligned read
Short answeratty has an API that can cause undefined behaviour from safe code: Potential unaligned read. No fixed version yet.
| Crate | atty |
|---|---|
| Type | Unsound |
| Affected versions | Every version. |
| Fixed in | none |
| Severity | Low (GitHub rating) |
| Published | 2021-07-04 |
| Last changed | 2023-11-08 |
| Also known as | GHSA-g98v-hv3f-hcfr |
What to do
- Find who pulls it in:
cargo tree -i atty. - Avoid the affected API, or replace the crate.
Details from the advisory
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
References
- Package: crates.io/crates/atty
- Advisory: rustsec.org/advisories/RUSTSEC-2021-0145.html
- Report: github.com/softprops/atty/issues/50
- Web: github.com/softprops/atty/pull/51
- Report: github.com/softprops/atty/issues/57
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for atty
Up next
Same crateatty: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?