Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. whoami
  4. ›
  5. GHSA-w5w5-8vfh-xcjq

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

April 5, 2024

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

  • github.com/advisories/GHSA-w5w5-8vfh-xcjq
  • github.com/ardaku/whoami
  • github.com/ardaku/whoami/commit/d6ee13ed9e818aa51b8d86d95e8009a376289a40
  • github.com/ardaku/whoami/issues/91
  • rustsec.org/advisories/RUSTSEC-2024-0020.html

Code Behaviors & Features

Detect and mitigate GHSA-w5w5-8vfh-xcjq with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.5.3 before 1.5.0

Fixed versions

  • 1.5.0

Solution

Upgrade to version 1.5.0 or above.

Impact 8.2 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H

Learn more about CVSS

Weakness

  • CWE-121: Stack-based Buffer Overflow

Source file

cargo/whoami/GHSA-w5w5-8vfh-xcjq.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:16 +0000.