I attacked my own secret scanner and 7 of 8 tricks worked
Описание и применение
Tripwire, сканер секретов, был атакован через pull request, который изменял файлы игнорирования и базис, а также через symlink, специально созданный файл и доступ к локальному 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