rustsec-2025-0042
Vulnerability from osv_rustsec
Published
2025-07-11 12:00
Modified
2025-10-28 06:02
Summary
Uninitialized read after allocating MemBump
Details

The affected function, MemBump::new(), would allocate memory without initializing it. Subsequently calling the created value's various alloc methods would then read and write the start of that memory as a Cell which is undefined behavior. Instead, it should zero initialize the start of the allocated memory.

For instance, some values could violate the internal invariants of the type and cause an assertion failure. Nevertheless, no deterministic read is known to cause further uninitialized memory to be exposed.

Affected downstream users that can not upgrade are advised to call MemBump::reset immediately after allocation to manually perform the missing write of the counter best-as-possible.

The flaw was corrected in commit d8d6a7d096d3aaafd963b356a8f1bbd8d26fd967 by zeroing the Cell at the start of the allocated memory.


{
  "affected": [
    {
      "database_specific": {
        "categories": [
          "memory-exposure",
          "memory-corruption"
        ],
        "cvss": null,
        "informational": "unsound"
      },
      "ecosystem_specific": {
        "affected_functions": null,
        "affects": {
          "arch": [],
          "functions": [
            "static_alloc::unsync::MemBump::new"
          ],
          "os": []
        }
      },
      "package": {
        "ecosystem": "crates.io",
        "name": "static-alloc",
        "purl": "pkg:cargo/static-alloc"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.2.2-0"
            },
            {
              "fixed": "0.2.6"
            }
          ],
          "type": "SEMVER"
        }
      ],
      "versions": []
    }
  ],
  "aliases": [
    "GHSA-xrrq-rrgq-h89w"
  ],
  "database_specific": {
    "license": "CC0-1.0"
  },
  "details": "The affected function, `MemBump::new()`, would allocate memory without\ninitializing it. Subsequently calling the created value\u0027s various `alloc`\nmethods would then read and write the start of that memory as a `Cell` which is\nundefined behavior. Instead, it should zero initialize the start of the\nallocated memory.\n\nFor instance, some values could violate the internal invariants of the type and\ncause an assertion failure. Nevertheless, no deterministic read is known to\ncause further uninitialized memory to be exposed.\n\nAffected downstream users that can not upgrade are advised to call\n`MemBump::reset` immediately after allocation to manually perform the missing\nwrite of the counter best-as-possible.\n\nThe flaw was corrected in commit d8d6a7d096d3aaafd963b356a8f1bbd8d26fd967 by\nzeroing the Cell at the start of the allocated memory.",
  "id": "RUSTSEC-2025-0042",
  "modified": "2025-10-28T06:02:18Z",
  "published": "2025-07-11T12:00:00Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://crates.io/crates/static-alloc"
    },
    {
      "type": "ADVISORY",
      "url": "https://rustsec.org/advisories/RUSTSEC-2025-0042.html"
    },
    {
      "type": "REPORT",
      "url": "https://github.com/197g/static-alloc/issues/81"
    }
  ],
  "related": [],
  "severity": [],
  "summary": "Uninitialized read after allocating MemBump"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…