Skip to main content

doormat

Find the passwords people leave next to the label that says "Password".

CI Security Docs PyPI License: MIT OR Apache-2.0 Python versions Rust core Status: alpha


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 CONCAT in 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-light. Two small runtime dependencies (openpyxl, and defusedxml to refuse malicious XML inside spreadsheet files). 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)

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 with openpyxl dominates: about 11 s to read a workbook with 1.9 million cells against 0.35 s of detection.

How it works

  1. Extract. Python reads every cell, formula and comment in a single pass and sends the workbook to Rust in one call.
  2. Featurize. Each cell is normalized once and tagged with bitmask flags (character classes, header keywords via Aho-Corasick) and Shannon entropy.
  3. Select candidates. Cells with header keywords, high entropy, formulas, comments or inline patterns are kept and classified as headers or values.
  4. Group. Adjacent candidates are clustered into regions with a breadth-first search over a 7x7 neighbourhood.
  5. 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/.ods files 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's zipfile, 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 Password column 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 .xls files expose no formulas or comments through xlrd, so those pathways only apply to .xlsx, .xlsm and .ods.
  • Python only. Bindings for other languages are planned, as is a command-line tool.

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 .xls files from the web readable, faster extraction of large workbooks, credential columns read past 1,000 rows
  • 0.5.0: a command-line scanner with SARIF and JSON output, tables without an account column, a Rust .xlsx reader for dense workbooks

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.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for doormat 0.4.0
File Size Uploaded Provenance Actions
doormat-0.4.0.tar.gz 90.2 kB With provenance Details for doormat-0.4.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for doormat 0.4.0
File Actions
doormat-0.4.0-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details for doormat-0.4.0-cp310-abi3-win_arm64.whl
doormat-0.4.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for doormat-0.4.0-cp310-abi3-win_amd64.whl
doormat-0.4.0-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for doormat-0.4.0-cp310-abi3-musllinux_1_2_x86_64.whl
doormat-0.4.0-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for doormat-0.4.0-cp310-abi3-musllinux_1_2_aarch64.whl
doormat-0.4.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for doormat-0.4.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
doormat-0.4.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for doormat-0.4.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
doormat-0.4.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for doormat-0.4.0-cp310-abi3-macosx_11_0_arm64.whl
doormat-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for doormat-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 8.7 MB

Release files / doormat-0.4.0.tar.gz

Download URL doormat-0.4.0.tar.gz
Size 90.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6e012a1e77a46e48f24089fe89bac980eff790eeb634e829d5b7bb6f994b1f80
BLAKE2b-256 checksum
How to use checksums
e75472d104a961fc101cbb61e9e060970d19c06850fe41a75d637b1be13b64f1
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 Oct 25, 2026.

Transparency log

Release files / doormat-0.4.0-cp310-abi3-win_arm64.whl

Download URL doormat-0.4.0-cp310-abi3-win_arm64.whl
Size 819.1 kB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
4b1c3879087dae2fec65f1892eaf546448389c541ce57a15aaff3352b7301b66
BLAKE2b-256 checksum
How to use checksums
ce2bd7b1f0fb2493c7ab45e9503c6cdaac8fc00484f30838300fe11b6a2d3768
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 Oct 25, 2026.

Transparency log

Release files / doormat-0.4.0-cp310-abi3-win_amd64.whl

Download URL doormat-0.4.0-cp310-abi3-win_amd64.whl
Size 870.6 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
1d98bc3c6cb8528bc6850ff7daae8dd9115f956f2ea4ec3823a1e442a591d9b0
BLAKE2b-256 checksum
How to use checksums
b69ecf2facfa96468821a197b2b99c4fc360257bb97f45c9ee152682a3708e70
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 Oct 25, 2026.

Transparency log

Release files / doormat-0.4.0-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL doormat-0.4.0-cp310-abi3-musllinux_1_2_x86_64.whl
Size 1.4 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
097a07ff8c22f88e44ac708827ccdb77a52a8ca045264a61bfe81f2a013e0e29
BLAKE2b-256 checksum
How to use checksums
d9a1f32bdb2d4f6f6041bc1981086591d95b5d69e47b342be73d22bdc94af97e
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 Oct 25, 2026.

Transparency log

Release files / doormat-0.4.0-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL doormat-0.4.0-cp310-abi3-musllinux_1_2_aarch64.whl
Size 1.3 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
29610a149f86b9f889c3bc1bc487a99591b1295a774cb1025ab29053a84acb2e
BLAKE2b-256 checksum
How to use checksums
c0ea0c708d6c2525af978b04ee3909c4bcba5aeba367b941f35b6d9d56a21711
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 Oct 25, 2026.

Transparency log

Release files / doormat-0.4.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL doormat-0.4.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
45e208ce753e70d39339df1acd8abb496009e5176444299b9f54c22fb69cfa07
BLAKE2b-256 checksum
How to use checksums
3d745a8b1a7715b0a980f741ef8402cfde67b3b4149b602f06e34fd273c3b74a
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 Oct 25, 2026.

Transparency log

Release files / doormat-0.4.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL doormat-0.4.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.1 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
0e8c77eb956d5e256c5e0e67b87a06ce478b0f81297555e67ffb2b5283e6451c
BLAKE2b-256 checksum
How to use checksums
85eac52de2cd52f1e436acd434fb2880c06321ebd7fb1c680d9cdba8cc852139
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 Oct 25, 2026.

Transparency log

Release files / doormat-0.4.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL doormat-0.4.0-cp310-abi3-macosx_11_0_arm64.whl
Size 976.1 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f4987581d3a06e571bbbac4ad0b547cc2c620984a9a8669aa289f2f3fad03bbf
BLAKE2b-256 checksum
How to use checksums
fc01bc7636deca3631b7043be0a4fc2c447dc82d220288b1b8dcb5cefde9c110
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 Oct 25, 2026.

Transparency log

Release files / doormat-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL doormat-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 1.0 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
9a3a7f13ba46d4390bdbef2a3bde5bcb434e1842b7e84cd8382800853d63d656
BLAKE2b-256 checksum
How to use checksums
b4f1b1d995430cf681e7f2cffaa277ced1f8f956b241ab23e18df49859c4436f
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 Oct 25, 2026.

Transparency log

Security for doormat 0.4.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.

Select from 9 files

Attestation for doormat-0.4.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 Oct 25, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page