Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.5.0] - 2026-11-09¶
A command-line scanner for CI gates and file-share sweeps, with masked output, SARIF, allowlists and location-only baselines; and .xlsx files read by doormat's own Rust reader, up to 5.5 times faster on large workbooks with output identical to 0.4.0's. doormat now installs no other packages. Findings on the Enron corpus and evaluation sets A, A2 and B are the same as 0.4.0's.
Added¶
doormat scan PATH..., a command-line scanner (alsopython -m doormat). It walks files and directories in a pool of worker processes, with--include/--excludeglobs, and prints a table, JSON lines or SARIF 2.1.0. Values are shown as a fixed-width mask, long labels are cut, and reasons and error messages are left out unless--revealis given; SARIF output never contains values and its fingerprints are location-only. Exit status 0 clean, 1 findings at or above--min-confidence(default 120), 2 any file or sheet not fully read, with findings still reported. It is a thin layer overload()with no detection logic of its own; on the Enron corpus it reports the same findings as a direct scan. Documented with CI and pre-commit examples (design decision 0019, #10)doormat scan --allowlist FILEignores findings matching a hand-written JSON allowlist (path pattern, optional sheet and cell).--write-baseline FILErecords the current findings and--baseline FILEthen reports only new ones, so a CI gate can be adopted on a repository that already has findings. Entries hold the location, label (cut at 40 characters) and detection pathway, never the value or anything derived from it; paths are relative to the file, and writing from a partial run keeps the entries of files not scanned. WithDOORMAT_BASELINE_KEYset, entries also carry an HMAC-SHA256 tag of the value bound to its cell, so a changed value in a recorded cell is reported as new (design decision 0020, #10)
Changed¶
.xlsxand.xlsmfiles are read by doormat's own Rust reader (new cratedoormat-xlsx), in the same call as detection. Its output is identical to the openpyxl-based reader's on all 15,871 Enron.xlsxfiles, the fixtures and sets A and A2; on set B's 1,622.xlsxfiles one sheet that openpyxl refused over an empty column width is now read. Findings are unchanged on Enron (322) and sets A, A2 and B. File and sheet errors keep the Python exception names they had (design decision 0021, #20)- Breaking:
openpyxlanddefusedxmlare no longer dependencies; doormat installs nothing else (xlrdandodfpystay optional extras).doormat.extract.extract_xlsxkeeps its signature; the openpyxl helpersclean_comment,collect_merge_origins,extract_single_sheetand theextract_workbookalias are removed - The research export (
doormat-coreonly) reads a column below a label to its end, as the detection pipeline does since 0.4.0, with column statistics from one pass per column, and appends six features after the first 36 (42 in all, still no value text).TABLE_MAX_ROWS, which only the export used, is removed. The Python package and every finding are unchanged (design decision 0018)
Performance¶
- Large
.xlsxworkbooks load up to 5.5 times faster: the 10 slowest Enron workbooks take 11.0 s instead of 61 s (alternating with 0.4.0 in one session), and a workbook with 1.9 million cells about 3.4 s instead of 11 s
[0.4.0] - 2026-10-25¶
Reads more real files: about a third more .xls files from the public web, large .xlsx workbooks up to 5 times faster with none wrongly refused, and credential columns past 1,000 rows. Findings on the Enron corpus and on evaluation set B are the same as 0.3.0's.
Added¶
doormat-coregains a research export (research::export_sheet,export_workbook) for an experiment with a learned scorer. It lists every candidate the detection pathways could propose, plus prose, everyday-keyword and label-gap forms, each with 36 numeric features and no value text. The Python package, its one call per workbook and every finding are unchanged (design decision 0016)
Fixed¶
- A credential table column, or a column of configuration-variable values, longer than 1,000 rows was cut off silently at row 1,001: a 1,088-row password column in a public-web spreadsheet lost its last 88 rows. Both columns are now read to their end (the walk already stops at a new label or after more than one empty row, so its length is bounded by the column itself). The research export keeps its documented 1,000-row bound. No Enron, set A, A2 or set B file has such a column: all four report identically, and the pipeline benchmarks are unchanged
- A default
load()refused some real.xlsxworkbooks as too large: themax_cellslimit counted cells that hold only a style, and a sheet formatted across whole rows stores millions of them. 5 of the 15,871 Enron.xlsxfiles were refused, one with 55,000 cells of content and 14.8 million parsed. Cells holding only a style are now removed before parsing and not counted; none of the 15,871 is refused (#8) .xlsfiles whose workbook stream shares a sector with another stream were refused (CompDocError: Workbook corruption). In a sample of spreadsheets from the public web (Fuse corpus) that was about a third of all.xlsfiles; on the sample's design split, 2,209 of them now yield cells, and no file that read before changes. A workbook stream declared larger than the file is refused withValueError, since the relaxed check no longer stops a file reusing its sectors to build one.doormat[xls]now needsxlrd>=2.0.1- Reading some
.xlsfiles printed xlrd's warnings and sector dumps (WARNING *** file size ... not 512 + multiple of sector size) to stdout; they are now discarded
Performance¶
.xlsxsheets with many formatted empty cells read up to 5 times faster: cells holding only a style are removed from the sheet XML before openpyxl parses it. On the 10 slowest Enron workbooks, timed alternately in one session, 118.6 s fell to 44.6 s (the slowest from 51 s to 11 s); sheets without such cells are within 1%. Extraction output is identical on all 15,871 Enron.xlsxfiles. The filter runs on untrusted bytes before any XML parser, so every span of its pattern is bounded (the longest real cell tag is 30 bytes) and its cost stays linear on hostile input (#8)
Validation¶
- Evaluation set B (
bench/web/): 36,439 spreadsheets from the public web (Fuse corpus), split by layout family, protocol committed before download and answer key before the run. On 11,200 test files with 60 credentials, 0.3.0 and this version both find 58 (all in one account table) with 58 of 74 findings correct; outside that table they miss a password written in prose and one two cells from its label, and raise 16 false alarms. This version reads 10,656 of the test files, against 6,640. Seebench/web/RESULTS.md - The README's accuracy table now gives test and dev figures in separate columns; it had mixed dev precision with test recall
Documentation¶
- Design decision 0017: the learned scorer tested against the research export is not adopted, and doormat keeps its hand-set confidences
- Design decision 0015 (reading
.xlsfiles with shared sectors, and the stream-size bound that replaces xlrd's check) - Design decisions 0013 (forged zip sizes fail closed: parts are read through
zipfile, which stops at the declared size, so the zip-bomb limits hold without a byte-counting reader) and 0014 (removing style-only cells), each correcting an earlier record's evidence - The threat model and README no longer say forged zip sizes get past the zip-bomb check
[0.3.0] - 2026-10-17¶
Measured on the Enron corpus, precision rose from 59.3% to 93.5% on dev and from 67.8% to 90.0% on test, and test recall from 34.7% to 61.4%; see bench/corpus/README.md and bench/exports/RESULTS.md for which parts are independent evidence.
Added¶
- Credential tables: a
Passwordcolumn with one account per row is reported row by row (reasontable_column, confidence 190). The column qualifies only when a username or ID label shares its header row and at least 80% of the cells below are single tokens, so help-desk logs, form templates and notes columns do not. On the Enron corpus it finds 44 of 46 table credentials on dev and 47 of 100 on test, with no false positives; seebench/corpus/README.mdfor which parts of that are independent - Credential tables follow their account column: the username or ID label may sit up to 10 columns from the password header, and empty passwords no longer end the table. Password-manager and browser exports with the password column further from the username (Dashlane) are now read row by row
load(..., max_cells=2_000_000): a file is refused withValueErroronce more cells than this have been read. Cells are counted while each sheet is parsed, so an oversized workbook fails early instead of filling memory;Noneremoves the limit (#12)- Compound credential labels: an identifier-style label such as
MYSQL_ROOT_PASSWORD,login_password,mail__options__auth__passorME_CONFIG_MONGODB_ADMINPASSWORDis a credential label when its final part is a credential word;POSTGRES_PASSWORD_FILEand..._PASSWORD_HASHare not. In a list of configuration variables each label takes the value across from it (reasonvariable_value),..._KEY/..._SALTlabels count when the value is key material, andNAME=valuelines are read as inline credentials. Switches (yes,true,0) and signed or decimal amounts are never reported as credentials (#19) - TOTP secrets:
totpandotpsecretare secret labels, so a TOTP column in an export is reported like a password column
Fixed¶
.xlsxtext beginning with=was treated as a formula, so a stored password such as=k9X...was never reported; only real formula cells are formulas now- An empty form field (
Password:with nothing to its right) was paired with the label below it (Date,Region), the largest false-positive family on the Enron corpus (#7) - A
Passwordcategory value repeated down a column (a help-desk ticket log) was paired with the cell beside it; such a label may still head a credential table - Inline values inside a URL query (
otpauth://...?secret=X&issuer=Y) ran on past& .odssheets containing a merged range were skipped and listed inGridDoc.errors: LibreOffice writes covered cells for every merged range, and reading their span failed. Found by a randomised before/after test of the refactored reader- Table cells holding a placeholder (
N/A,TBD,none,?,xxxx,****) are no longer reported docs/how-it-works.mdpointed to the wrong steps for the inline pattern and formula handling, and ended with a strayEOFline
Performance¶
- Recognising compound labels costs about 3-4% in the Rust core on the criterion benchmarks (
process_sheet1k cells 137 µs, 5k cells 718 µs; 10 sheets of 5k cells 2.7 ms), measured in one session against the previous commit. The credential-word scan runs once per cell, in the same pass as label detection
Documentation¶
- The documentation site is built with Zensical, the successor to Material for MkDocs (whose security fixes end in November 2026), keeping the same configuration and look (#14)
- Design decision records under
docs/decisions/(ten so far, from removingarrow2to the cell limit), each with its options and evidence (#13)
Validation¶
- Credential-table answer key for dev (
bench/corpus/creds_dev_tables.json), built from the keyword pool independently of the detector;evaluate.pyreportstable_columnfindings as their own pathway - New fixture
15_credential_table.xlsx - Evaluation set A2 (
bench/configs/): configuration variables from the Docker Official Images documentation, 11 image families split into design, holdout and test before any result. Test split, run once: recall 12/81 -> 81/81, precision 98.8%. Set A's test split, re-run (not independent): Bitwarden and Chromium passwords 140 -> 592 of 605. Seebench/configs/RESULTS.md - Evaluation set A (
bench/exports/): spreadsheets in 8 documented password-manager and browser export layouts, generated from a protocol committed before any data or result. Test split, run once: 100% precision, 23% password recall (Chromium 140/140; Bitwarden 0/465, whoselogin_passwordheader is not recognised). Enron: test precision 80.6% -> 90.0% and dev 66.0% -> 93.5% with recall unchanged. Seebench/exports/RESULTS.md
[0.2.0] - 2026-10-13¶
First release under the name doormat (previously gridmap, never published).
Added¶
- CSV and TSV extraction via the stdlib
csvmodule (single sheet, named after the file) .xlsextraction via optionalxlrd>=2.0(doormat[xls]); formulas and comments are not available.odsextraction via optionalodfpy>=1.4(doormat[ods]), including formulas and annotations.xlsmaccepted and routed through the xlsx extractordoormat[all]extra installing both optional dependencies- Magic-byte validation for
.xlsx,.xlsm,.xlsand.odsbefore parsing
Changed¶
- Breaking: Python 3.10 or newer is required (3.9 reached end of life in October 2025). Tested on 3.10 and 3.14
- Renamed the project from
gridmaptodoormat, because the PyPI namegridmapbelongs to another project. The Python import is nowdoormat, the crates aredoormat-coreanddoormat-py, and the extension module isdoormat._core. The public API (load(),GridDoc,Relationship) is unchanged python/gridmap/extract.pysplit into thegridmap.extractpackage (nowdoormat.extract) with one module per format;extract_workbookkept as an alias forextract_xlsxdoormat.load()dispatches on file extension and raisesValueErrorfor unsupported extensions or mismatched file signatures- A
.csvor.tsvfile that is not valid UTF-8, or has a field over thecsvmodule's size limit, is reported inGridDoc.errorsinstead of raisingValueError - Inline detection no longer matches whitespace-separated forms such as
(800) 555-0100 PIN 1234orpassword for Sheet = x. On the Enron corpus these patterns were mostly false positives (offshore block names, pipeline interconnect IDs, prose)
Added¶
- A sheet that cannot be parsed no longer fails the whole file. It is listed in
GridDoc.errorsas aSheetError(sheet, kind, message)and the other sheets are still scanned;GridDoc.completeisTrueonly when every sheet was read.repr(SheetError)omits the message, which can quote file content. Problems with the file as a whole (missing, wrong format, zip bomb, unreadable workbook structure) still raise - Every finding now says where it is:
Relationship.sheet,row,col(1-based),header_row,header_col,hidden, and the A1-stylecoordinateandheader_coordinateproperties
Changed¶
- Breaking:
Relationship.header_cell_idandvalue_cell_id(internal, per-sheet indices) are removed in favour of the location fields above - Breaking: deduplication is per cell instead of per value. The same credential in two cells, or on two sheets, is now two findings; previously all but one were silently dropped
- Findings are returned in a stable reading order (sheet, then row and column) instead of an arbitrary order
repr(Relationship)no longer includes the credential value, so findings can be logged safelydoormat._core.process_sheetis removed;process_workbookis the single FFI entry point
Packaging¶
- Eight prebuilt wheels instead of five: Linux x86_64 and aarch64 for both glibc (manylinux) and musl (Alpine), macOS arm64 and x86_64, Windows x64 and arm64. Every wheel is built on a runner of its own architecture and installed and tested there;
abi3auditverifies each one uses only the stable ABI - Documentation site at https://dipan010.github.io/doormat/: API reference, how detection works, threat model and evaluation
- Ships type information (
py.typed, plus a stub for the compiled extension);mypy --strictpasses on the package and checks user code against it - Wheels use the CPython stable ABI (
abi3): one wheel per platform works on CPython 3.10 and every newer version. Other platforms build from the source distribution - The source distribution and wheels now include both licence files
Security¶
- Release and CI workflows pin every GitHub Action to a commit SHA, do not persist checkout credentials, scope elevated permissions to the jobs that need them, and are audited by zizmor on every push
- A sheet whose declared range is far larger than its content (one formatted cell at
XFD1048576claims about 17 billion positions) made the.xlsxextractor run indefinitely. It now visits only the cells present in the file. Similarly, an.odscell repeated a billion times was expanded cell by cell; repeated empty cells are now skipped and repeated values are capped at 16,384 columns. Both reproduced with files under 100 KB .xlsx,.xlsmand.odsfiles are checked for zip bombs before parsing: more than 10,000 archive parts, more than 512 MiB of declared content (configurable withload(..., max_uncompressed_bytes=...)), or any part of 10 MiB or more compressed beyond 500:1 is refused withValueError. Limits were calibrated on 15,871 real spreadsheets (largest 353 MB, highest ratio 157:1), none of which are refused. The check reads only the archive directory, so it trusts declared sizes- XML containing entity declarations is refused instead of being parsed: in a worksheet, that sheet is skipped and reported in
GridDoc.errors; in the workbook structure,load()raisesValueError.defusedxmlis now a dependency; openpyxl uses it automatically, which blocks entity-expansion attacks ("billion laughs") and external entities in.xlsxfiles - Upgraded
pyo30.22 to 0.29, resolving RUSTSEC-2025-0020 (buffer overflow risk inPyString::from_object) and RUSTSEC-2026-0177 (missingSyncbound on closures) - Updated
crossbeam-epochto 0.9.21, resolving RUSTSEC-2026-0204 - Removed the unmaintained
arrow2crate (RUSTSEC-2025-0038, no fixed release).CellStorenow uses plainVeccolumns; the affected API was never called.cargo auditandcargo denyreport no advisories
Performance¶
- Reading
.xlsxfiles only visits cells present in the file: total time over the 15,929-file Enron corpus fell from 8,510 s to 3,798 s (-55%), with identical findings - The
.xlsxreader skips parts that hold no cells (pivot tables and caches, charts, images, defined names, document properties, the theme). On 300 Enron files timed back to back it takes 58% less time than openpyxl's own loader, with identical output; summed per-file time over the full corpus is now about 27 minutes - Compared with 0.1.0 in the same benchmark session:
process_sheetabout 17% faster (1k and 5k cells) andprocess_workbookabout 8% faster (10 sheets of 5k cells), while also resolving each finding's location - Dropping
arrow2moves cell strings instead of copying them into Arrow buffers:from_rawis 24% faster,process_sheet12% andprocess_workbook6% on the criterion benchmarks
Fixed¶
.xlsfiles reported whole-number cells as floats, so a numeric password12345678was returned as12345678.0- In
.odsfiles, rows after a non-empty row repeated more than 1,000 times were reported with the wrong row number - Four Enron workbooks that timed out now load
.xlsxworkbooks with a malformed part that holds no cells were refused entirely: an invalid print-titles name (#N/A) or a pivot cache with-where a number belongs. The extractor now reads only shared strings, the sheet list, styles and worksheets, and skips defined names, print settings, document properties, the theme and pivot caches. Every file in the Enron corpus now loads- Array formulas in
.xlsxfiles were extracted as a Python object description (<openpyxl...ArrayFormula object at 0x...>) instead of the formula text, so credentials in them were missed. Data-table cells, which have no formula text, are now treated as empty - Inline detection ran on formula cells, whose value is the formula text, producing a garbled duplicate of the formula finding
- Inline and formula keyword patterns missed keywords after
_or.(DB_PASSWORD=x,app.pwd: x,"API_KEY") because\btreats_as a word character; the formula keyword pattern also matched inside words (spin,monkey) - Workbooks with broken external-link parts raised
KeyErrorin openpyxl; external links are now skipped (keep_links=False). This recovered 64 of 73 failing files in the Enron corpus - A formula cell next to a password label was paired as its value (
Password:→=SUM(...)). Formula cells are no longer spatial value candidates; literal strings in formulas are still detected load()raisedAttributeErroron any workbook containing a chartsheet- Inline credential pattern matched keywords inside words (
spin,compass,by-pass) and treated plain whitespace as a key/value separator. Keywords must now be whole words, and the separator must be:,=or a spaced dash; password-family keywords also accept a single digit-bearing token after whitespace - Split-password detection concatenated form labels (
Post ID:,Database:) and table columns of separate passwords. Fragments must now stand alone in their column and not end in: - Spatial pairing preferred a nearby label or sentence over the real value next to the header. Candidates ending in
:get a -80 penalty and candidates containing whitespace get -40
Validation¶
- Real-world evaluation on the Enron spreadsheet corpus (15,929 files) under
bench/corpus/. v0.1.0 measured 16.5% precision and 31.2% recall on the held-out test split; the current code measures 59.3% precision on the dev split (out of sample), and 67.8% precision / 34.7% recall on test (in sample). Seebench/corpus/README.md
[0.1.0] - 2026-06-29¶
Added¶
- Spatial credential inference engine over xlsx workbooks
- Detection pathways: inline same-cell, spatial-adjacent, split-across-cells, formula-hidden, comment-hidden
- Multilingual password header detection (15+ languages) via Aho-Corasick multi-pattern matching
- Hybrid Arrow/Vec columnar storage backend (
CellStorewith arrow2 immutable columns and Vec workspace) - Sheet-level parallelism via Rayon (
process_workbook) - Shannon entropy computation, skipped by a bitmask pre-filter for most cells
- BFS region detection with a
VecDequequeue - Spatial distance table with pre-computed 7x7 score grid
- Scoring engine with distance, character-class, entropy, region, and context bonuses
- Split-password detection (2-5 cells below header)
- Python API:
gridmap.load(),GridDoc,Relationship - Extraction layer via openpyxl supporting formulas, comments, merged cells, hidden sheets
- PyO3 bindings (
gridmap._core) with panic-safe FFI boundary - Criterion benchmark suite with phase-level and sub-phase-level baselines
- 14 synthetic test fixture workbooks covering all detection pathways
- Precision/recall benchmark harness (
bench/harness/run_harness.py)
Changed¶
- Comment merge on duplicate coordinates: merges into the existing cell instead of creating duplicates
- Workbook opened once with
data_only=False: avoids reopening for formula extraction - Spatial index contains all cells, not just candidates
- Regex patterns compiled once via
LazyLock
Performance¶
- Fused
normalize_and_flags()with ASCII fast path:precompute_features-32% - Buffer swap pattern for zero-allocation normalization across cells
MutableUtf8Arrayfor incremental Arrow buffer construction infrom_raw: -3%- End-to-end pipeline improvement:
process_sheet(5k cells) 1,102 µs -> 927 µs (-16%) - End-to-end workbook improvement:
process_workbook(10x5k) 4,402 µs -> 3,330 µs (-24%)
Internal¶
- 121 Rust unit tests across 10 modules
- 54 Python tests (unit + integration)
- 100% precision, 100% recall on 14 synthetic fixtures
- Sub-phase profiling infrastructure (
benches/subphases.rs) - Deterministic benchmark fixture generator with xorshift32 PRNG