I attacked my own secret scanner and 7 of 8 tricks worked-
A pull request could turn my secret scanner's check off by editing one file. I tried 8 variations of that trick, and 7 of them worked. I built Tripwire after Railway, PHP and LiteLLM all had a very bad few days last wee
A pull request could turn my secret scanner's check off by editing one file. I tried 8 variations of that trick, and 7 of them worked.
I built Tripwire after Railway, PHP and LiteLLM all had a very bad few days last week. The same question came up everywhere: which of our secrets are out there, which ones still work, and what can each one reach? Answering that from memory is a great way to rotate the wrong key first. This post covers what the tool does, then what broke when I went after it.
TL;DR
| Attack on Tripwire | What it did | Status |
|---|---|---|
| Pull request edits the ignore file or baseline | Turned the check green while adding a key | Fixed, with a test |
| Symlink inside the repo | Made the scanner read files outside the repo | Fixed, with a test |
| One crafted file | Froze the scanner for 22 seconds | Fixed, with a test |
| Local API on shared Wi-Fi | Reachable by anyone on the same network | Fixed, with a test |
Try it in 10 seconds
npx tripwire-scan scan .
Point it at any repo. It scans your files and your git history, because deleting the line doesn't delete the key. The package is on npm: https://www.npmjs.com/package/tripwire-scan
Commands
npx tripwire-scan scan . # scan the current repo, files and history
npx tripwire-scan scan owner/repo # scan any GitHub repo
npx tripwire-scan scan . --verify # ask each provider if the key is live
npx tripwire-scan scan . --diff origin/main # only fail on secrets added since main
npx tripwire-scan scan . --fail-on-vulns high # also fail on high severity vulnerable deps
npx tripwire-scan contain . # dry run: revoke plan, changes nothing
npx tripwire-scan contain . --apply # revoke live keys, then re-check each one
npx tripwire-scan baseline . # accept existing findings, block only new ones
npx tripwire-scan install-hook # add the pre-commit hook
npx tripwire-scan honey check # exit 1 if a decoy key was used
It exits 1 when something blocks, 0 when clean and 2 on a usage error, so it drops into CI as is. Other flags include --min-confidence, --history, --skip-vulns, --json and --markdown. For false positives, add a tripwire:ignore comment on the line or a glob in .tripwireignore.
What Tripwire does
- finds leaked keys in files and in history, using 230+ provider rules including the Gitleaks default pack
- draws what each key unlocks, so you can see the chain from one database URL to production
- asks the provider whether the key still works (AWS, GitHub, Stripe, Slack, OpenAI, Anthropic, SendGrid and npm so far)
- gives you a revoke plan, worst first
- checks dependencies against OSV.dev and can open the fix PR
- plants decoy AWS keys (via Canarytokens) that email you when someone uses them
Every finding carries a confidence level, and placeholders, hashes, test fixtures and lockfile noise are filtered out. Base64, URL-encoded and hex values get decoded and rescanned.
Verify and contain. --verify makes one read-only "who am I" call per key to its own provider and marks it live, revoked or unverified. tripwire contain is a dry run until you add --apply. With --apply it revokes what the provider has an API for (GitHub, Slack, GitLab, AWS) and then checks that the provider now rejects the key. Everything else gets an ordered runbook with the dashboard link.
Where it runs. CLI, a pre-commit hook that refuses a commit adding a key in a fraction of a second, and a GitHub Action. On pull requests the action fails only on secrets the PR adds, annotates the lines, and keeps one summary comment up to date.
That PR check is where my own tool turned out to be weakest.
Attacking it
A scanner reads files it doesn't control, and in CI it runs next to tokens. That makes it a decent target, so I spent a day trying to break Tripwire the way a hostile contributor would.
1. A pull request could switch the check off
Tripwire honors a .tripwireignore file and a baseline file so teams can adopt it on an old codebase without a wall of red. Both are files in the repo, so a pull request can edit them. A PR that adds a key and also ignores the file it sits in gets a green check.
I tried 8 variations of this, and 7 of them got through. Now a PR cannot change its own ignore rules or baseline to hide a finding, and anything hidden by an inline tripwire:ignore comment is listed in the report so a reviewer can see it.
2. A symlink read files outside the repo
The scanner walks the repo and reads text files. A symlink pointing outside the repo was followed, so scanning a hostile repo meant reading files from the machine doing the scan. That's fixed, so a symlink can't pull the scanner outside the repo.
3. One crafted file froze it for 22 seconds
A single file I built on purpose made the scanner hang for 22 seconds. For a pre-commit hook that should finish in a fraction of a second, that's a broken tool. It's fixed, and that file is now a test case.
4. The local API was reachable from the same Wi-Fi
The web UI talks to a local API with endpoints that scan repos and can trigger revocation. It was reachable by anyone on the same network. Revocation does nothing unless apply is exactly true, but a stranger at a coffee shop shouldn't be able to ask your machine to scan anything. It's fixed, so other machines on the network can't use it.
Each fix has a regression test.
Where it falls short
On provider coverage Tripwire is level with Gitleaks. Using TruffleHog's detector tests (743 providers with example credentials), Tripwire recognizes 347 and Gitleaks recognizes 351. TruffleHog covers far more. My own benchmark corpus is written by me, so I treat it as a regression gate and not a ranking.
It won't stop a platform breach like Railway's, and it can't see secrets that exist only in a platform's dashboard. It cleans up the repo side of the mess and makes the response less chaotic.
Automatic revocation has only been tested against stubbed provider responses, not live accounts. If you try --apply, use a throwaway token first. AWS keys are deactivated and not deleted, and the undo command is printed and logged.
Come break it
Tripwire is a few days old and MIT licensed. False positives, missed providers and strange repos are all welcome.
Two questions for the comments:
- Which provider should I add next?
- What's the sneakiest way you've seen a CI check get bypassed?
Repo: https://github.com/X3PH1RE/tripwire
npm: https://www.npmjs.com/package/tripwire-scan
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.

