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

Not scored Published

A stack buffer overflow in the whoami Rust crate allows attackers to cause denial of service or potentially execute code on Unix platforms.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Not stated
Victim action needed
Not needed
Fix
Available

What is GHSA-w5w5-8vfh-xcjq?

GHSA-w5w5-8vfh-xcjq is a memory corruption vulnerability in whoami, published on 28 Feb 2024.

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

Which versions are affected by GHSA-w5w5-8vfh-xcjq?

3 open source packages ship an affected version, including whoami.

PackageAffectedFixed in
whoami crates.ioFrom 0.5.31.5.0
whoami crates.ioFrom 0.5.31.5.0
whoami crates.ioFrom 0.5.31.5.0

How do I fix GHSA-w5w5-8vfh-xcjq?

Upgrade whoami to 1.5.0 or later.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is GHSA-w5w5-8vfh-xcjq being exploited?

There is no known exploitation of GHSA-w5w5-8vfh-xcjq in the wild and no public exploit code.

Sources

Also known as RUSTSEC-2024-0020.

Is GHSA-w5w5-8vfh-xcjq in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free