Skip to content

whoami stack buffer overflow on several Unix platforms

High severity GitHub Reviewed Published Apr 5, 2024 to the GitHub Advisory Database

Package

cargo whoami (Rust)

Affected versions

>= 0.5.3, < 1.5.0

Patched versions

1.5.0

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.

References

Published to the GitHub Advisory Database Apr 5, 2024
Reviewed Apr 5, 2024

Severity

High
8.2
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H

Weaknesses

CVE ID

No known CVE

GHSA ID

GHSA-w5w5-8vfh-xcjq

Source code

Checking history
See something to contribute? Suggest improvements for this vulnerability.