Email me

Rust advisories / whoami

Vulnerability HighRUSTSEC-2024-0020 · whoami

RUSTSEC-2024-0020: Stack buffer overflow with whoami on several Unix platforms

Short answerA security vulnerability in the whoami crate: Stack buffer overflow with whoami on several Unix platforms. GitHub rates it High. Fixed in 1.5.0: update to a fixed version.

Cratewhoami
TypeVulnerability (denial-of-service, memory-corruption)
Affected versionsFrom 0.5.3 before 1.5.0.
Fixed in1.5.0
SeverityHigh (GitHub rating)
Published2024-02-28
Last changed2024-04-11
Also known asGHSA-w5w5-8vfh-xcjq
Affected functionswhoami::realname, whoami::realname_os, whoami::username, whoami::username_os

What to do

  1. See which version you have: cargo tree -i whoami (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p whoami. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example whoami = "1.5.0") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

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.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Up next

Same cratewhoami: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ