7.5high
Out of bounds read in bumpalo
- Severity
- 7.5high CVSS:3.1 by NVD
- Exploit likelihood
- 1.51% (higher than 75% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-vqx7-pw4r-29rrRUSTSEC-2020-0006
Description
An issue was discovered in the bumpalo crate before 3.2.1 for Rust. The realloc feature allows the reading of unknown memory. Attackers can potentially read cryptographic keys.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| bumpalo (crates.io) | from 3.0.0 before 3.2.1 | GitHub Advisory Database, RustSec Advisory Database |
| bumpalo_project bumpalo | from 3.0.0 before 3.2.1 | NVD |
All scores
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| RustSec Advisory Database | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:N/A:N |
Classification
What each source says
CVE List
An issue was discovered in the bumpalo crate before 3.2.1 for Rust. The realloc feature allows the reading of unknown memory. Attackers can potentially read cryptographic keys.
RustSec Advisory Database
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:
-
While we were already running the testsuite under
valgrindin CI, becausevalgrindexits 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=1flag forvalgrindin CI so that tests eagerly fail in these scenarios. -
I've written a quickcheck test to exercise
realloc. Without the bug fix in this patch, this quickcheck immediately triggers invalid reads when run undervalgrind. We didn't previously have quickchecks that exercisedreallocbecausereallocisn't publicly exposed directly, and instead can only be indirectly called. This new quickcheck test exercisesreallocviabumpalo::collections::Vec::resizeandbumpalo::collections::Vec::shrink_to_fitcalls.
NVD (es)
Se detectó un problema en la crate bumpalo versiones anteriores a 3.2.1 para Rust. La funcionalidad realloc permite una lectura de memoria desconocida. Los atacantes pueden potencialmente leer claves criptográficas.
References
| https://rustsec.org/advisories/RUSTSEC-2020-0006.html | advisory, exploit, patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2020-35861 | advisory | |
| https://github.com/fitzgen/bumpalo/issues/69 | report, web | |
| https://github.com/fitzgen/bumpalo | package | |
| https://crates.io/crates/bumpalo | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2020-35861 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-vqx7-pw4r-29rr changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2020-0006 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2020-35861 changed 2026-06-17 | Public domain |