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 Precision Recall
0.1.0 16.5% 31.2%
0.2.0 59.3% 34.7%
current main 93.5% 61.4%

Precision is measured on the dev split and recall on the test split. main adds credential tables, which were designed on dev, so its dev precision is partly in sample, and most of its recall gain on test comes from copies of a workbook that also shaped the rule; treat both as optimistic; its later precision fixes target false-positive patterns first seen on dev. 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 very large real workbooks, reading the file with openpyxl dominates: about 27 s to read a 170,000-cell workbook against 0.1 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. Those checks trust the sizes declared inside the archive, which a determined attacker can forge; run doormat with a memory 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: tables without an account column, faster extraction of large workbooks, a per-file work limit; a command-line scanner is proposed

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), licensed CC BY 4.0. The corpus is not 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.3.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.3.0
File Size Uploaded Provenance Actions
doormat-0.3.0.tar.gz 77.0 kB With provenance Details for doormat-0.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for doormat 0.3.0
File Actions
doormat-0.3.0-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details for doormat-0.3.0-cp310-abi3-win_arm64.whl
doormat-0.3.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for doormat-0.3.0-cp310-abi3-win_amd64.whl
doormat-0.3.0-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for doormat-0.3.0-cp310-abi3-musllinux_1_2_x86_64.whl
doormat-0.3.0-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for doormat-0.3.0-cp310-abi3-musllinux_1_2_aarch64.whl
doormat-0.3.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.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
doormat-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for doormat-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
doormat-0.3.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for doormat-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
doormat-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for doormat-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 8.6 MB

Release files / doormat-0.3.0.tar.gz

Download URL doormat-0.3.0.tar.gz
Size 77.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9e0167c5b1c9c934359ad639d938fb25a1a3629e17d75142cfb1563e11f5317b
BLAKE2b-256 checksum
How to use checksums
08ae4a10300ae3e7efb1c30472e414ad0f2f6c99319c2b784cabc4875ed1111e
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 16, 2026.

Transparency log

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

Download URL doormat-0.3.0-cp310-abi3-win_arm64.whl
Size 816.2 kB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
ecd9269feb520e0f0f10b776f67bc00bcc7c0d3d02db2db612a541c9e0dac9ad
BLAKE2b-256 checksum
How to use checksums
7842bb6a5c5498e75237e76b4084f2d93370a53754fcaf6d303a0306994b8351
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 16, 2026.

Transparency log

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

Download URL doormat-0.3.0-cp310-abi3-win_amd64.whl
Size 867.4 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9f7c49e48e4188e263c8cfeb803b0da7e642e2f6b33a6777f58b908181507bbb
BLAKE2b-256 checksum
How to use checksums
2bc1050cc433df42b6c31b66c9945f2078fb32867e837aef36853e54d8fa71ab
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 16, 2026.

Transparency log

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

Download URL doormat-0.3.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
12ef8e0f210101cb3717b7cb4e774c86fca40cf1c70b21fdbbbd9ca99f7d0b85
BLAKE2b-256 checksum
How to use checksums
dece0d31514e4bf623a7067f901a652bce40f536554eddab7fa379c7fe9add13
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 16, 2026.

Transparency log

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

Download URL doormat-0.3.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
57479a60d412a7bce168e7eb86c44ecb5c35474baf7ed198daade6af445300e9
BLAKE2b-256 checksum
How to use checksums
b84657fd1180f1b40003d0cfa8ee80396e62a710d145940191e2dd22977831b8
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 16, 2026.

Transparency log

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

Download URL doormat-0.3.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
138e15ef8b1f5dc0b4bc013a8e267276e2fc877b540935498545c21c0af3823d
BLAKE2b-256 checksum
How to use checksums
003a1a52b54dda9145466879ae06ba0dcfbf118160a49ae8a6c2841946f06d5e
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 16, 2026.

Transparency log

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

Download URL doormat-0.3.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
68643a3943974b28f639205fb542f4cf23e97a6be3bc6e9b0e68334bfca56c17
BLAKE2b-256 checksum
How to use checksums
3202d568cfeb46c6de6187f6e5c11200c7e37ea1e3347480c492b4af6250e17e
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 16, 2026.

Transparency log

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

Download URL doormat-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
Size 971.9 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e613bb310105b5cd205e17bc99962265a77026be17c64c0fbe55813b8fba854d
BLAKE2b-256 checksum
How to use checksums
403c1cbdf26f351c472f0a6d133bf3bf1b28b777c53d6448b721832b45506244
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 16, 2026.

Transparency log

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

Download URL doormat-0.3.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
139aeeb446d16afe4693928198c1ea90dfec186553487a89300daedb7aa30c00
BLAKE2b-256 checksum
How to use checksums
06fab699373cba103a326d4d5ada45034f0a2125a04f78c5129fdeeed8549657
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 16, 2026.

Transparency log

Security for doormat 0.3.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.3.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 16, 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