doormat
Find the passwords people leave next to the label that says "Password".
People hide the spare key under the doormat. They hide passwords the same way: in the spreadsheet cell right next to Password:, in a cell that reads pwd = hunter2, or inside a database connection string. doormat reads .xlsx, .xls, .ods, .csv and .tsv files, models each sheet as a 2D grid, and pairs credential labels with the values around them.
- Spatial, not just regex. Scores every candidate value by its distance and direction from a credential label, its character mix and entropy, and nearby username or URL labels.
- Finds what grep misses. Credentials split across cells, built with
CONCATin formulas, or tucked into cell comments. - Fast. Rust core with sheet-level parallelism: under 1 ms for a 5,000-cell sheet. Python bindings via PyO3, one FFI call per workbook.
- Measured on real data. Precision and recall are reported on the public Enron spreadsheet corpus, not just synthetic fixtures. See Accuracy.
- Offline and dependency-free.
.xlsxfiles are read by doormat's own Rust reader, which refuses malicious XML; nothing else is installed with the wheel (.xlsand.odssupport are optional extras). No network calls, no model downloads.
Documentation: https://dipan010.github.io/doormat/ (API reference, how detection works, threat model, evaluation).
Installation
pip install doormat
Optional readers for legacy formats:
pip install "doormat[xls]" # Excel 97-2003 via xlrd
pip install "doormat[ods]" # OpenDocument via odfpy
pip install "doormat[all]" # both
Prebuilt wheels cover CPython 3.10 and newer on Linux (x86_64, aarch64), macOS (Intel, Apple Silicon) and Windows (x64). On other platforms pip builds from the source distribution, which needs a Rust toolchain. To work on doormat itself, see CONTRIBUTING.md.
Quickstart
import doormat
doc = doormat.load("it_handover.xlsx")
print(f"Scanned {doc.sheet_count} sheets, {doc.cell_count} cells")
for cred in doc.credentials(min_confidence=120):
print(f"{cred.sheet}!{cred.coordinate} {cred.key!r} -> {cred.value!r} score={cred.confidence:.0f}")
Scanned 2 sheets, 7 cells
Servers!B3 'Password' -> 's3cRet!99' score=210
Notes!A1 'VPN password' -> 'hunter2!' score=250
Findings come back in reading order: sheet by sheet, then row and column. A finding's repr never includes the secret, so logging one is safe:
>>> doc.credentials(120)[0]
Relationship(key='Password', sheet='Servers', cell='B3', confidence=210)
Command line
doormat scan shares/finance/ handover.xlsx
shares/finance/it.xlsx: Servers!B3: Password = ******** (confidence 210)
doormat: 1 finding(s) in 1 of 14 file(s)
doormat scan walks files and directories in parallel and prints a table, JSON lines (--format json) or SARIF 2.1.0 for code scanning (--format sarif). Values are masked unless you pass --reveal, and SARIF never contains them. Exit status: 0 nothing found, 1 findings at or above --min-confidence (default 120), 2 a file or sheet not fully read (findings are still reported). An allowlist (--allowlist) ignores known false alarms, and a baseline (--baseline, --write-baseline) makes CI fail only on new findings; both record locations, never values. See the command-line guide for filters, CI and pre-commit.
API
| Name | Description |
|---|---|
doormat.load(path, *, max_uncompressed_bytes=512 MiB, max_cells=2_000_000) |
Read a spreadsheet (str or pathlib.Path) and run detection. Returns a GridDoc. Raises FileNotFoundError, or ValueError for an unsupported extension, a file whose signature does not match it, a zip-based file that looks like a zip bomb, or a file with more cells than max_cells (counted while sheets are parsed). None lifts either limit. |
GridDoc.credentials(min_confidence=0.0) |
Relationships at or above a confidence score. 120 is a sensible default; scores above 200 are high-confidence inline or formula detections. |
GridDoc.relationships() |
Every inferred key/value relationship, regardless of score. |
GridDoc.sheet_count, GridDoc.cell_count |
Size of the scanned workbook (sheets that were read). |
GridDoc.errors, GridDoc.complete |
A sheet that cannot be parsed does not stop the scan: it is listed in errors as a SheetError(sheet, kind, message) and the other sheets are still scanned. complete is True when every sheet was read; check it when a scan must be exhaustive. |
Relationship |
Frozen dataclass: key, value, confidence, reason (a ;-separated breakdown of the score), and where it was found: sheet, row, col (1-based), header_row, header_col and hidden (the sheet is hidden). |
Relationship.coordinate, .header_coordinate |
Spreadsheet references of the value and label cells, e.g. "B3" and "A3". |
What it detects
| Pattern | Example |
|---|---|
| Value beside a label | Password: in A1, the value in B1 or A2 (within a 3-cell radius) |
| Inline key/value | Password: s3cret!, PWD=s3cret!, Password - s3cret! |
| Split across cells | A value spread over 2 to 5 cells under a header |
| Built in a formula | =CONCAT("password", "S3cure#1"), or a password: ... string literal in a formula |
| Hidden in a comment | A comment on a password header, or a comment containing password: ... |
| Multilingual labels | Password keywords in 15+ languages, including German, Spanish, French, Portuguese, Russian, Japanese, Chinese and Korean |
Supported formats
| Format | Extensions | Formulas | Comments | Extra |
|---|---|---|---|---|
| Excel (OOXML) | .xlsx, .xlsm |
yes | yes | none |
| Excel 97-2003 | .xls |
no | no | doormat[xls] |
| OpenDocument | .ods |
yes | yes | doormat[ods] |
| Delimited text | .csv, .tsv |
n/a | n/a | none |
The reader is chosen by file extension, and binary formats are checked against their magic bytes before parsing. CSV and TSV files are treated as one sheet named after the file.
Accuracy
On 15 synthetic fixtures, one per detection pathway, doormat scores 100% precision and recall. Real spreadsheets are harder. On the public Enron spreadsheet corpus (15,929 files):
| Version | Test precision | Test recall | Dev precision |
|---|---|---|---|
| 0.1.0 | 16.5% | 31.2% | not measured |
| 0.2.0 | 67.8% | 34.7% | 59.3% |
| 0.3.0 | 90.0% | 61.4% | 93.5% |
Only the 0.1.0 row is fully out of sample: later rules were designed from Enron's own errors (dev, and for 0.2.0 also test), so treat the rest as optimistic. 0.3.0's recall gain is credential tables, designed on dev and then run once on test (47 of 100 table credentials), but most of those 47 come from copies of a workbook that also shaped the rule, so that figure is optimistic too.
Out of sample on real files (set B). On 11,200 spreadsheets from the public web (the Fuse corpus), never used for tuning, with the answer key built before the run: 58 of 60 credentials found, 58 of 74 findings correct. All 58 found are one account table; outside it doormat found neither of the other 2 credentials (a password in prose, a label with its value two cells away) and raised 16 false alarms in 11,200 files. Inline credentials are found with few false positives. On spreadsheets laid out like password-manager and browser exports (bench/exports/), precision is 100% on every split. On spreadsheets that list configuration variables such as MYSQL_ROOT_PASSWORD (bench/configs/), recall is 100% and precision 98.8% on the test split. The method, labelling rubric and caveats are in bench/corpus/README.md.
Performance
Rust core only, Apple Silicon, criterion.rs on synthetic workbooks (measured 2026-10-16 for 0.3.0):
| Workbook | Time |
|---|---|
| 1 sheet, 1,000 cells | 137 µs |
| 1 sheet, 5,000 cells | 718 µs |
| 10 sheets, 5,000 cells each | 2.7 ms |
On large real workbooks, reading the file dominates. doormat's Rust .xlsx reader reads a workbook with 1.9 million cells in about 3.4 s (openpyxl, used before 0.5.0, took about 11 s), against 0.35 s of detection; the 10 slowest Enron workbooks load in 11 s, against 61 s with 0.4.0.
How it works
- Extract.
.xlsxand.xlsmfiles are read in Rust in the same call as detection; for.xls,.ods,.csvand.tsv, Python reads every cell, formula and comment in a single pass and sends the workbook to Rust in one call. - Featurize. Each cell is normalized once and tagged with bitmask flags (character classes, header keywords via Aho-Corasick) and Shannon entropy.
- Select candidates. Cells with header keywords, high entropy, formulas, comments or inline patterns are kept and classified as headers or values.
- Group. Adjacent candidates are clustered into regions with a breadth-first search over a 7x7 neighbourhood.
- Pair and score. Each credential label is paired with its best-scoring neighbour using distance, character mix, entropy, region membership and nearby username or URL labels. Labels, prose and formulas are penalized.
Sheets are processed in parallel with Rayon. Scoring is heuristic; there is no trained model.
Limitations
- Hostile files are checked, not sandboxed. XML entity attacks are refused, and
.xlsx/.xlsm/.odsfiles that would decompress beyond 512 MiB, or with a zip-bomb compression ratio, are rejected before parsing. Understated sizes do not get past the check: parts are read through Python'szipfile, which stops at the declared size. Parsing is still done by pure-Python libraries in your process, so run doormat with a memory and time limit when scanning files from untrusted sources at scale. - Some password tables are missed. A
Passwordcolumn is read as a table of accounts only when a username or ID label shares its header row; about half of the table credentials in the evaluation are still missed. - Legacy
.xlsfiles expose no formulas or comments through xlrd, so those pathways only apply to.xlsx,.xlsmand.ods. - Python only. Bindings for other languages are planned.
Roadmap
- 0.2.0: first PyPI release, published 2026-10-13
- 0.3.0: credential tables, compound labels such as
MYSQL_ROOT_PASSWORD, TOTP secrets, far fewer false positives - 0.4.0: more
.xlsfiles from the web readable, faster extraction of large workbooks, credential columns read past 1,000 rows - 0.5.0:
doormat scanwith SARIF and JSON output, allowlists and baselines; a Rust.xlsxreader, up to 5.5 times faster, with no runtime dependencies - Next: fewer false positives (postal PIN codes, captions and formula literals, header cells),
PWcolumn headers, and tables without an account column (#16)
All planned work is tracked in milestones; changes are listed in CHANGELOG.md.
Contributing
Bug reports and pull requests are welcome. Please follow the Code of Conduct. See CONTRIBUTING.md for building from source, running the tests and the benchmark harness, and adding a detection pathway.
Security
Please report vulnerabilities privately, as described in SECURITY.md. Never attach spreadsheets containing real credentials to issues; rebuild the layout with made-up values.
Acknowledgements
Real-world evaluation uses the Enron spreadsheet corpus by Felienne Hermans and Emerson Murphy-Hill ("Enron's Spreadsheets and Related Emails: A Dataset and Analysis", ICSE 2015) and the Fuse corpus by Titus Barik, Kevin Lubick, Justin Smith, John Slankas and Emerson Murphy-Hill ("Fuse: A Reproducible, Extendable, Internet-scale Corpus of Spreadsheets", MSR 2015), both licensed CC BY 4.0. Neither corpus is redistributed in this repository.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in doormat by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Metadata
Release files for doormat 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| doormat-0.5.0.tar.gz | 346.3 kB | With provenance | Details for doormat-0.5.0.tar.gz |
Built distributions (wheels)
Total release size: 11.3 MB
Release files / doormat-0.5.0.tar.gz
| Download URL | doormat-0.5.0.tar.gz |
|---|---|
| Size | 346.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c30bfa3401252d18ff9d4f41b643acd9fab167062e6f20d255abb1db929882aa
|
|
BLAKE2b-256 checksum How to use checksums |
4951727d2252a46f12075680979ecf256f6e462cd11d93dad48729dacdb7d892
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / doormat-0.5.0-cp310-abi3-win_arm64.whl
| Download URL | doormat-0.5.0-cp310-abi3-win_arm64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
506d278bd2d09e979c77378e71a89c4e409f51696fb631cdf732f69508b68f2e
|
|
BLAKE2b-256 checksum How to use checksums |
48f0a48a387a0f9fe0336a29db506a1d442ba066502e43d14e18f67eba89d216
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / doormat-0.5.0-cp310-abi3-win_amd64.whl
| Download URL | doormat-0.5.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
58299bcd32b22c2b1e25629a843d7b1d4a9e00650e6ca276a9f6047fc4b5bff6
|
|
BLAKE2b-256 checksum How to use checksums |
a990bf1d63f7ceb82475b7173faef25cd9b53932d802c6cc7afae5097cb2a52a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / doormat-0.5.0-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | doormat-0.5.0-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5aa8f8f06f736ccaa5106a48edd15aa630f9c258f5794b0dfe7bb984259edc46
|
|
BLAKE2b-256 checksum How to use checksums |
b23cac9fda69d9b3c89144b39185074e24c88f816d4e75168575494c8247da32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / doormat-0.5.0-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | doormat-0.5.0-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
01b79ccac16053ac9c489ebf75daf1e3156e928bb7ae26d37e888d4168939876
|
|
BLAKE2b-256 checksum How to use checksums |
9f767254ae4e3e972045e0c6e2c2875296cb7463cecfd50540f340b1011e5af1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / doormat-0.5.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | doormat-0.5.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e333258f7b36d7f35178777cc5fc663bb7cd47cbb5489e8d05ccbc752d2256ab
|
|
BLAKE2b-256 checksum How to use checksums |
b943be10f2a1b125d0334049aa32f43a931efcb1a1959c988b2f704a6b3a4a0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / doormat-0.5.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | doormat-0.5.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
0eb4e9647d550928444f68c9cc5967361e835c7a86ed0e38fe03eb1d95b9896e
|
|
BLAKE2b-256 checksum How to use checksums |
9e1e166bdc534c12d9d7e26244551e4186c1f4769cf7ec8f789fd4f69ffd2891
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / doormat-0.5.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | doormat-0.5.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
13e2a7828dfaaf224403d7e5d5940acea4eb1ed2d95c8a51f382d9b73e6d72e4
|
|
BLAKE2b-256 checksum How to use checksums |
a8dd325a11288246b71fe17147a3df496736015cf01539f01750d94568191fc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / doormat-0.5.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | doormat-0.5.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
2b5c1856d75387e726b8ae37f9dec4d9a5706179f4d3014c8288e715011b18c4
|
|
BLAKE2b-256 checksum How to use checksums |
ee71ee4aa83f3906cb3c7d34372214aaa7f78e0bfb3f6977a702be3a261a99d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logSecurity for doormat 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 9 files in this release have been uploaded with provenance metadata.
Attestation for doormat-0.5.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.