GHSA-w5w5-8vfh-xcjq

Suggest an improvement
Source
https://github.com/advisories/GHSA-w5w5-8vfh-xcjq
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/04/GHSA-w5w5-8vfh-xcjq/GHSA-w5w5-8vfh-xcjq.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-w5w5-8vfh-xcjq
Aliases
Published
2024-04-05T15:39:19Z
Modified
2024-04-11T16:41:43.737392Z
Severity
  • 8.2 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H CVSS Calculator
Summary
whoami stack buffer overflow on several Unix platforms
Details

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.

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-121"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2024-04-05T15:39:19Z"
}
References

Affected packages

crates.io / whoami

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.5.3
Fixed
1.5.0