CVE-2021-26951
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Calamine before 0.17.0 uses unsafe Vec::set_len without reserving memory, allowing heap corruption via uninitialized read operations.
Vulnerability
CVE-2021-26951 is a memory-safety vulnerability in the calamine crate (Rust) affecting versions prior to 0.17.0. The bug resides in the Sectors::get function, which unsafely calls Vec::set_len to extend the internal buffer without first reserving the required capacity. This allows writing into uninitialized heap memory via a user-controlled Read operation [1][2].
Exploitation
An attacker can trigger the vulnerability by providing a specially crafted spreadsheet file (e.g., XLS or ODS) that causes the library to read data into the uninitialized region. No authentication or special network position is required; any code path that opens a malicious file with the affected crate can exploit the issue [3]. The get method directly uses r.read(&mut self.data[len..end]) on memory that may overlap with other allocations, leading to heap corruption.
Impact
Successful exploitation can lead to arbitrary heap memory overwrites, potentially enabling code execution, data corruption, or information disclosure. The RustSec advisory assigns a CVSS score of 9.8 (Critical) due to the network attack vector and the lack of privileges required [4].
Mitigation
Users should update to calamine version 0.17.0 or later, which properly reserves memory before calling set_len. No workarounds are available; running an unpatched version with untrusted files poses a serious risk [1][4].
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
calaminecrates.io | < 0.17.0 | 0.17.0 |
Affected products
3- Rust/calaminedescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4- github.com/advisories/GHSA-ppqp-78xx-3r38ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2021-26951ghsaADVISORY
- github.com/tafia/calamine/issues/199ghsaWEB
- rustsec.org/advisories/RUSTSEC-2021-0015.htmlghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.