A 512-byte workbook can provoke a multi-gigabyte allocation and abort the process
Affected versions passed caller-supplied bytes to `calamine`'s `Xlsx::new` without first checking that they were a ZIP archive. `Xlsx::new` tests for password protection on its first line, which parses the input as an OLE/CFB container, and a sector-count field read from the file's own header reaches `Vec::with_capacity` without being checked against the file's actual length. A 512-byte input can therefore request several gigabytes; 9,261,285,372 bytes was measured. **The oversized allocation is always attempted. Whether it aborts depends on what the allocator can satisfy.** On a large host with overcommit the reservation is granted untouched and the call returns an ordinary "not an xlsx file" error, which looks like a malformed file being correctly rejected. Under a memory limit the same bytes give `memory allocation of N bytes failed` and the process aborts, which is not a `Result` a caller can handle. Containers with a memory limit, small hosts and CI runners are where this lands, so testing on a development machine can wrongly suggest the crate is unaffected. Every entry point reaches it, not only `compare_bytes`: the path- and reader-based APIs funnel through the same internal open. Neither `Limits::default()` nor `Limits::hardened()` prevents it, because `max_input_bytes` bounds the length of the input while the allocation's size comes from a field inside it. Fixed in 3.2.0, which declines input that does not begin with the ZIP magic before the parser sees it, removing
RUSTSEC-2026-0317
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:RUSTSEC-2026-0317
sheets-diff
Source reference: /affected/0/package/name
- Affected versions
- Not stated in this record
- Fixed versions
- 3.2.0
Source reference:
/affected/0/ranges - Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.0.0-0"
},
{
"fixed": "3.2.0"
}
]
}
],
"package": {
"name": "sheets-diff",
"purl": "pkg:cargo/sheets-diff",
"ecosystem": "crates.io"
},
"database_specific": {
"cvss": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H",
"source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0317.json",
"categories": [
"denial-of-service"
],
"informational": null
},
"ecosystem_specific": {
"affects": {
"os": [],
"arch": [],
"functions": []
},
"affected_functions": null
}
}
]Publisher severity
No explicit severity was provided.
- Event
- #59375 · Revision 1
- Added to Heist Feed
- Publisher date