Repository navigation
test(security): cargo-fuzz targets with output-safety oracle; reject XLS records that panic calamine - #48
Merged
Conversation
chaliy
force-pushed
the
claude/project-thread-ulbh3z
branch
from
October 27, 2026 03:20
5fefeb8 to
3dae6b3
Compare
The xls_biff fuzz target found calamine reading BIFF records without bounds checks (process abort under panic = "abort"). - Pre-scan rejects truncated FILEPASS/CODEPAGE/DATEMODE/BOF/BOUNDSHEET/ LBL/EXTERNSHEET, SST strings cut before cRun/cbExtRst or followed by an empty CONTINUE, MERGECELLS count overruns, full-range MULRK and empty-range DIMENSIONS - Defined-name tokens checked for their fixed length - Formula token streams neutralised (cce = 0): only cached values render - Sheet scan follows calamine past embedded chart substreams - calamine reads a container rebuilt from the scanned stream, closing the cfb vs calamine CFB reader differential - 16-byte DIMENSIONS records accepted
… workflow Seven targets in crates/markkit/fuzz (html, document, docx_xml, xlsx_xml, ods_xml, xls_biff, render_ir) assert the S14 pulldown-cmark oracle, not just no-panic. Structure-aware targets wrap fuzzed XML / BIFF in valid containers via the tests/common builders. - .github/workflows/fuzz.yml: nightly matrix, validated duration input, cached corpora, crash artifacts - just fuzz / just fuzz-build - knowledge/security/fuzzing.md: targets, oracle, triage, findings
chaliy
force-pushed
the
claude/project-thread-ulbh3z
branch
from
October 27, 2026 03:42
3dae6b3 to
fecdac6
Compare
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Михайло · project thread
What changed
crates/markkit/fuzzcover every parser and the renderer:html,document(sniffed raw bytes),docx_xml,xlsx_xml,xlsb_bin,ods_xml,xls_biff,pdf,markdown,csvandrender_ir(arbitrary IR trees). Every target checks the S17 output-safety oracle with pulldown-cmark, so it catches more than panics: no raw HTML, no disallowed link schemes, and no text escaping its container..github/workflows/fuzz.ymlruns all of them nightly and uploads crashes.just fuzz <target> [secs]andjust fuzz-buildrun them locally.xls_bifftarget found calamine panicking on about a dozen truncated BIFF record shapes and in its formula decompiler. The XLS pre-scan now rejects those shapes and neutralises formula token streams (cce = 0; only cached values render). calamine then reads a container rebuilt from the exact stream we scanned.security/fuzzing.mdcovers targets, seeds, triage and the "fix before the dependency sees it" rule, alongside T6c threat-model updates, testing.md, the AGENTS row, the log and the CHANGELOG.Why
This is roadmap initiative 1 (extraordinary security testing).
catch_unwinddoesn't help in WASM or inpanic = "abort"embedders, so a dependency panic has to be prevented before calamine sees the input.Before / After
panic = "abort"builds. There was no fuzzing.invalid XLSerror instead, with regression tests indocument_security.rs. Local runs were all clean:cargo test --workspace, clippy-D warnings, fmt andcheck-okfall pass.cargo +nightly fuzz build -Obuilds all eleven targets.Risk
miniz_oxide), and fixed that here.Checklist
Generated by Claude Code