I attacked my own secret scanner and 7 of 8 tricks worked
说明与用途
Tripwire,秘密扫描器,通过修改忽略文件和基线的拉取请求、符号链接、专门构造的文件以及本地 API 进行攻击。修复并测试后,漏洞已被消除。
问题
A secret scanner (Tripwire) could be bypassed by a pull request that edits ignore files or baseline, allowing a PR to add a key while hiding it from the scan.
结果
After testing eight attack vectors, seven succeeded in bypassing Tripwire. Fixes were implemented and regression tests added, restoring Tripwire’s integrity against PR‑based attacks.
工作流
- 1. Create a PR that edits .tripwireignore or baseline to ignore the file containing a new key.
- 2. Run Tripwire as a pre‑commit hook or GitHub Action.
- 3. Observe that the check passes because the key is hidden.
- 4. Apply fixes: disallow PRs from modifying ignore files, ignore symlinks, add test for crafted file, secure local API.
- 5. Re‑run Tripwire to confirm the key is detected and the check fails.
证据
Tripwire honors a .tripwireignore file and a baseline file so teams can adopt it on an old codebase without a wall of red.
A symlink pointing outside the repo was followed, so scanning a hostile repo meant reading files from the machine doing the scan.
A single file I built on purpose made the scanner hang for 22 seconds.
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.
- 记录日期: 2026-10-27T09:11:14.575Z