Skip to content

Updates calamine to 0.38.0 to remove a reader panic on malformed .xls files - #3466

Merged
HakanSeven12 merged 1 commit into
HakanSeven12:mainfrom
travisjhughes:calamine-update
Nov 23, 2026
Merged

HakanSeven12 merged 1 commit into
HakanSeven12:mainfrom
travisjhughes:calamine-update

Conversation

@travisjhughes

@travisjhughes travisjhughes commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Change summary

calamine reads the spreadsheet of a data link. Version 0.36.1 has the advisory RUSTSEC-2026-0436: a panic and an allocation without a limit in the compound file reader on a malformed file (.xls files and VBA projects). Version 0.38.0 repairs it.

This change moves calamine from 0.36.1 to 0.38.0. No source file of the app changes: the API that the app uses is the same.

What specifically changed

One commit.

  • Cargo.toml: calamine = "0.38.0".
  • Cargo.lock, from cargo update -p calamine --precise 0.38.0:
    • calamine 0.36.1 → 0.38.0;
    • quick-xml 0.41.0 → 0.42.0;
    • new: zip 9.8.1 (for calamine; the app keeps zip 8.6.0, so the build has both), typed-path 0.13.0, constant_time_eq 0.6.1, nix 0.32.0, zeroize_derive 1.5.0.

Why

  • cargo audit on main 965e1976c reports RUSTSEC-2026-0436 for calamine 0.36.1, patched in 0.38.0 and later. With this change the report has no line for calamine (21 advisories before, 20 after).
  • A linked spreadsheet is a file from other people. An allocation without a limit can end the app with no message, and no catch_unwind stops that.

Other changes of 0.37 and 0.38 that a user of a data link can see (from the changelog of calamine):

Change Effect in a linked table
.xlsb: a whole-number cell with a date format is a date, not an integer The cell text can change
.xlsx: _xHHHH_ escapes are decoded for all code units Text with such escapes changes
.xls: a WORKBOOK stream name in capitals is accepted Files open that did not open
.xls: BIFF5 strings in multibyte code pages are decoded correctly Text in Shift-JIS, GBK, Big5 is correct
.ods: error cells give their text; tabs and line breaks are kept The cell text can change

Testing

On main 0ca03459b.

  • Before and after (cargo test --workspace --locked --no-fail-fast, cargo check --workspace --all-targets, clippy, the wasm32 check, the golden file): 7,729 passed and 1 failed before; 7,730 passed and 0 failed after. No other difference. One test of main, picklocked_off_makes_locked_layer_objects_unselectable, failed in the run of main and passed in the run with this change; it also passed in three other runs on the same main, so it is not stable on main and not from this change. Warnings, the wasm32 check, clippy, rustfmt and the golden file are the same.
  • The data link tests of src/app/annotation_data.rs that read a workbook pass with 0.38.0.
  • No new test. I do not have a file that shows the advisory's faults on 0.36.1 and not on 0.38.0. The damaged file that I made panics in both versions (see "Not covered").
  • Fault injection with cargo mutants: not run. The diff has no source code.

Not covered

  • calamine 0.38.0 still panics on a damaged .xls file: Sectors::get_chain (src/cfb.rs) follows the sector chain with fats[sector_id as usize] and does not check the index. A 512-byte file is enough. The app needs its own catch_unwind around the reads for that; that is a separate change (Prevents a crash when a data link reads a damaged spreadsheet #3465). The calamine project has a report of the panic (its issue 764), and its master branch (93e2e6b) gives an error for that file. No release has that repair yet.
  • Two versions of zip in the build. To remove the second one, the app must move to zip 9.
  • The other advisories of the cargo audit report.

Impact to Contributors

None.

Co-Authored-By: Claude

RUSTSEC-2026-0436: calamine before 0.38.0 can panic and can allocate
without a limit in its compound file reader on a malformed .xls file.
A linked spreadsheet of a drawing reaches that reader. The update adds
zip 9 next to zip 8 in the lockfile, and moves quick-xml 0.41 to 0.42.

Co-Authored-By: Claude
@HakanSeven12
HakanSeven12 merged commit 36571a4 into HakanSeven12:main Nov 23, 2026
8 checks passed
@travisjhughes
travisjhughes deleted the calamine-update branch November 23, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants