# GHSA-w5w5-8vfh-xcjq: whoami stack buffer overflow on several Unix platforms

- Severity: High 8.2 (CVSS:3.1, scored by GitHub) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2024-02-28T12:00:00.000Z
- Modified: 2024-04-11T16:41:43.737Z
- Also known as: RUSTSEC-2024-0020
- Weaknesses: CWE-121

## Description

With versions of the whoami crate >= 0.5.3 and < 1.5.0, calling any of these functions leads to an immediate stack buffer overflow on illumos and Solaris:

- `whoami::username`
- `whoami::realname`
- `whoami::username_os`
- `whoami::realname_os`

With versions of the whoami crate >= 0.5.3 and < 1.0.1, calling any of the above functions also leads to a stack buffer overflow on these platforms:

- Bitrig
- DragonFlyBSD
- FreeBSD
- NetBSD
- OpenBSD

This occurs because of an incorrect definition of the `passwd` struct on those platforms.

As a result of this issue, denial of service and data corruption have both been observed in the wild. The issue is possibly exploitable as well.

This vulnerability also affects other Unix platforms that aren't Linux or macOS.

This issue has been addressed in whoami 1.5.0.

For more information, see [this GitHub issue](https://github.com/ardaku/whoami/issues/91).

(As written by GitHub Advisory Database.)

## Affected

- whoami (crates.io): from 0.5.3 before 1.5.0

## References

- <https://github.com/ardaku/whoami/issues/91> (report, web)
- <https://github.com/ardaku/whoami/commit/d6ee13ed9e818aa51b8d86d95e8009a376289a40> (web)
- <https://github.com/ardaku/whoami> (package)
- <https://rustsec.org/advisories/RUSTSEC-2024-0020.html> (advisory, web)
- <https://crates.io/crates/whoami> (package)

## Sources

- GitHub Advisory Database: [GHSA-w5w5-8vfh-xcjq](https://github.com/advisories/GHSA-w5w5-8vfh-xcjq), CC-BY-4.0, modified 2024-04-11
- RustSec Advisory Database: [RUSTSEC-2024-0020](https://rustsec.org/advisories/RUSTSEC-2024-0020.html), CC0-1.0, modified 2024-04-11

---

Page: https://cve.day/GHSA-w5w5-8vfh-xcjq · Whole record: https://cve.day/GHSA-w5w5-8vfh-xcjq.json · Rebuilt by cve.day 2026-11-25T22:56:43.188Z
