9.8critical
Out of bounds write in calamine
- Severity
- 9.8critical CVSS:3.1 by NVD
- Exploit likelihood
- 1.75% (higher than 78% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-ppqp-78xx-3r38RUSTSEC-2021-0015
Description
An issue was discovered in the calamine crate before 0.17.0 for Rust. It allows attackers to overwrite heap-memory locations because Vec::set_len is used without proper memory claiming, and this uninitialized memory is used for a user-provided Read operation, as demonstrated by Sectors::get.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| calamine (crates.io) | before 0.17.0, from 0.0.0-0 before 0.17.0 | GitHub Advisory Database, RustSec Advisory Database |
| calamine_project calamine | before 0.17.0 | NVD |
All scores
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| RustSec Advisory Database | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Classification
What each source says
CVE List
An issue was discovered in the calamine crate before 0.17.0 for Rust. It allows attackers to overwrite heap-memory locations because Vec::set_len is used without proper memory claiming, and this uninitialized memory is used for a user-provided Read operation, as demonstrated by Sectors::get.
RustSec Advisory Database
Affected versions of this crate arbitrarily calls Vec::set_len to increase length of a vector without claiming more memory for the vector. Affected versions of this crate
also calls user-provided Read on the uninitialized memory of the vector that was
extended with Vec::set_len.
This can overwrite active entities in adjacent heap memory and seems to be a major security issue. Also, calling user-provided Read on uninitialized memory is defined as UB in Rust.
NVD (es)
Se detectó un problema en la crate calamine versiones anteriores a 0.17.0 para Rust. Permite a atacantes sobrescribir las ubicaciones de la memoria de la pila porque la función Vec::set_len es usada sin el requerimiento de memoria apropiado, y esta memoria no inicializada se usa para una operación de Lectura proporcionada por el usuario, como es demostrado por la función Sectors::get
References
| https://rustsec.org/advisories/RUSTSEC-2021-0015.html | advisory, exploit, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-26951 | advisory | |
| https://github.com/tafia/calamine/issues/199 | report, web | |
| https://github.com/tafia/calamine | package | |
| https://crates.io/crates/calamine | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-26951 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-ppqp-78xx-3r38 changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0015 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2021-26951 changed 2026-06-17 | Public domain |