CVE-2021-26951
JSON

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 packageVersionsReported by
Unspecified productn/aCVE List
calamine (crates.io)before 0.17.0, from 0.0.0-0 before 0.17.0GitHub Advisory Database, RustSec Advisory Database
calamine_project calaminebefore 0.17.0NVD

All scores

GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
RustSec Advisory Database9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD7.5high CVSS:2.0AV: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

Sources

SourceRecordLicence
CVE ListCVE-2021-26951 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-ppqp-78xx-3r38 changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0015 changed 2023-11-08CC0-1.0
NVDCVE-2021-26951 changed 2026-06-17Public domain