Email me

Rust advisories / bumpalo

Vulnerability HighRUSTSEC-2020-0006 · bumpalo

RUSTSEC-2020-0006: Flaw in `realloc` allows reading unknown memory

Short answerA security vulnerability in the bumpalo crate: Flaw in `realloc` allows reading unknown memory. High severity (CVSS 7.5). Fixed in 3.2.1: update to a fixed version.

Cratebumpalo
TypeVulnerability (memory-exposure)
Affected versionsFrom 3.0.0 before 3.2.1.
Fixed in3.2.1
SeverityHigh, CVSS 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Published2020-03-24
Last changed2023-11-08
Also known asCVE-2020-35861, GHSA-vqx7-pw4r-29rr

What to do

  1. See which version you have: cargo tree -i bumpalo (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p bumpalo. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example bumpalo = "3.2.1") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

When reallocing, if we allocate new space, we need to copy the old allocation's bytes into the new space. There are old_size number of bytes in the old allocation, but we were accidentally copying new_size number of bytes, which could lead to copying bytes into the realloc'd space from past the chunk that we're bump allocating out of, from unknown memory.

If an attacker can cause reallocs, and can read the realoced data back, this could allow them to read things from other regions of memory that they shouldn't be able to. For example, if some crypto keys happened to live in memory right after a chunk we were bump allocating out of, this could allow the attacker to read the crypto keys.

Beyond just fixing the bug and adding a regression test, I've also taken two additional steps:

1. While we were already running the testsuite under valgrind in CI, because valgrind exits with the same code that the program did, if there are invalid reads/writes that happen not to trigger a segfault, the program can still exit OK and we will be none the wiser. I've enabled the --error-exitcode=1 flag for valgrind in CI so that tests eagerly fail in these scenarios.

2. I've written a quickcheck test to exercise realloc. Without the bug fix in this patch, this quickcheck immediately triggers invalid reads when run under valgrind. We didn't previously have quickchecks that exercised realloc because realloc isn't publicly exposed directly, and instead can only be indirectly called. This new quickcheck test exercises realloc via bumpalo::collections::Vec::resize and bumpalo::collections::Vec::shrink_to_fit calls.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Other advisories for bumpalo

Full security history of bumpalo

Up next

Same cratebumpalo: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ