Skip to content

doormat 0.4.0

Choose a tag to compare

@dipan010 dipan010 released this 25 Oct 10:27
· 26 commits to main since this release
521d354
pip install --upgrade doormat

Documentation: https://dipan010.github.io/doormat/

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-core gains 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 .xlsx workbooks as too large: the max_cells limit counted cells that hold only a style, and a sheet formatted across whole rows stores millions of them. 5 of the 15,871 Enron .xlsx files 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)
  • .xls files 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 .xls files; 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 with ValueError, since the relaxed check no longer stops a file reusing its sectors to build one. doormat[xls] now needs xlrd>=2.0.1
  • Reading some .xls files printed xlrd's warnings and sector dumps (WARNING *** file size ... not 512 + multiple of sector size) to stdout; they are now discarded

Performance

  • .xlsx sheets 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 .xlsx files. 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. See bench/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 .xls files 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