GHSA-w5w5-8vfh-xcjq
JSON

8.2high

whoami stack buffer overflow on several Unix platforms

Severity
8.2high CVSS:3.1 by GitHub
Published
Last changed
Also known as
RUSTSEC-2024-0020

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.

Affected

Product or packageVersionsReported by
whoami (crates.io)from 0.5.3 before 1.5.0GitHub Advisory Database, RustSec Advisory Database

Classification

References

Sources

SourceRecordLicence
GitHub Advisory DatabaseGHSA-w5w5-8vfh-xcjq changed 2024-04-11CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2024-0020 changed 2024-04-11CC0-1.0