GHSA-w5w5-8vfh-xcjq: Whoami Whoami Stack Buffer Overflow On Vulnerability

HIGH
CVSS 8.2
CWE-121
Published
Advisory Summary

GHSA-w5w5-8vfh-xcjq is a HIGH (CVSS 8.2) whoami stack buffer overflow on vulnerability (CWE-121: Stack-based Buffer Overflow) affecting Whoami libraries in the crates.io ecosystem. The issue involves whoami stack buffer overflow on several unix platforms. Remediation is available by upgrading affected packages to version 1.5.0.

GHSA-w5w5-8vfh-xcjq at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-w5w5-8vfh-xcjq
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-121: Stack-based Buffer Overflow
Affected Product Whoami
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 8.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability High (A:H)

How to Fix GHSA-w5w5-8vfh-xcjq

To remediate this vulnerability, upgrade all affected Whoami dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

whoami fixed: 1.5.0
Upgrade whoami to 1.5.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for whoami

How to Check if You Are Affected

To determine whether your application is affected by GHSA-w5w5-8vfh-xcjq, inspect your project dependencies for Whoami:

inspect dependencies for whoami

Analyze the terminal output to locate any version of Whoami in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-121: Stack-based Buffer Overflow, where a stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function). In Whoami, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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](https://github.com/ardaku/whoami/issues/91).

GHSA-w5w5-8vfh-xcjq Affected Whoami Versions

1 component(s)
Fixed Versions:
1.5.0
Product / Package Ecosystem Affected Versions Fixed Version
whoami
crates.io
≥ 0.5.3
< 1.5.0
1.5.0

References

Frequently Asked Questions

What is GHSA-w5w5-8vfh-xcjq?
GHSA-w5w5-8vfh-xcjq is a security vulnerability in Whoami involving whoami stack buffer overflow on several Unix platforms under CWE-121: Stack-based Buffer Overflow.
Which Whoami versions are affected?
Affected versions include releases prior to 1.5.0 across affected packages: whoami.
What version fixes GHSA-w5w5-8vfh-xcjq?
Upgrading to 1.5.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is whoami affected?
Yes, whoami is affected in releases prior to 1.5.0. Upgrade your dependency to 1.5.0 or later.
What is the CVSS score of GHSA-w5w5-8vfh-xcjq?
GHSA-w5w5-8vfh-xcjq has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H.
What CWE is associated with GHSA-w5w5-8vfh-xcjq?
GHSA-w5w5-8vfh-xcjq is classified under CWE-121: Stack-based Buffer Overflow (A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).).
How can I check crates.io dependencies for GHSA-w5w5-8vfh-xcjq?
Run the dependency tree command: 'inspect dependencies for whoami'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w5w5-8vfh-xcjq",
  "modified" : "2024-04-05T15:39:19Z",
  "published" : "2024-04-05T15:39:19Z",
  "aliases" : [ ],
  "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:\n\n- `whoami::username`\n- `whoami::realname`\n- `whoami::username_os`\n- `whoami::realname_os`\n\nWith 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:\n\n- Bitrig\n- DragonFlyBSD\n- FreeBSD\n- NetBSD\n- OpenBSD\n\nThis occurs because of an incorrect definition of the `passwd` struct on those platforms.\n\nAs 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.\n\nThis vulnerability also affects other Unix platforms that aren't Linux or macOS.\n\nThis issue has been addressed in whoami 1.5.0.\n\nFor more information, see [this GitHub issue](https://github.com/ardaku/whoami/issues/91).\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "whoami"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.5.3"
      }, {
        "fixed" : "1.5.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ardaku/whoami/issues/91"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ardaku/whoami/commit/d6ee13ed9e818aa51b8d86d95e8009a376289a40"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ardaku/whoami"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2024-0020.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-121" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-05T15:39:19Z",
    "nvd_published_at" : null
  }
}