Detail bug report: View on Detail
recoverInstallation accepted an arbitrary, unvalidated installationId string from any authenticated user with no format validation, no rate limit, and no retention pruning on the installation_access_checks table. An attacker could rotate installation ids to enqueue unlimited recover-installation jobs (each costing at least one GitHub App API call), permanently grow the table (nothing ever pruned it), and flood Sentry with per-job failure warnings.
The root cause: the endpoint's inputValidator was a pass-through, the queue's singletonKey only coalesced identical in-flight jobs (distinct ids bypassed it), and the table had no TTL cleanup — the only deletion path was the ON DELETE CASCADE FK on user deletion.
Closes #172
recoverInstallation's inputValidator now rejects non-numeric installationId values (/^\d+$/) before the handler runs — GitHub installation ids are positive integers.countRecentInstallAccessChecks(db, userId, 60) before writing/enqueuing. If the user already has ≥ 5 distinct installation ids in the last 60 seconds, it throws a rate-limit error. The count is on distinct ids because the upsert on (user_id, forge, installation_id) collapses repeats — exactly the dimension an attacker rotates to burn quota.pruneInstallAccessChecks(db, maxAgeDays) function deletes rows with verified_at < now() - maxAgeDays. A daily pg-boss schedule (prune-installation-access-checks, cron 30 3 * * *) calls it with INSTALL_ACCESS_CHECK_RETENTION_DAYS = 7 (new contracts constant), bounding table growth.countRecentInstallAccessChecks and pruneInstallAccessChecks (9 tests) covering the rate-limit count semantics, per-user isolation, and the retention prune window.recover-installation integration test (11 tests) and organizations integration test (55 tests) pass with no regression.recoverInstallation is still classified "authed" with the same middleware chain.Automatic Fixes PRs can be configured here.
The latest updates on your projects. Learn more about Unkey Deploy
| Name | Status | Preview | Inspect | Updated (UTC) |
|---|---|---|---|---|
| tripwire / web (preview) | Ready | Visit Preview | Inspect | Nov 7, 2026 6:56am |
Capy couldn't review this pull request because grim's workspace is out of credits, add credits or enable auto-reload to resume automatic reviews.
@detail-app[bot], Tripwire blocked this change request.
Rate limit: You opened 59 change requests in a short time. Wait before you open another.
A new commit will not fix this.
If you think it should merge anyway, say so in a comment. A maintainer will decide.
Re: github.com/Boring-Software-Inc/…/185 — Tripwire's block is a rate limit on this bot opening change requests (59 in a short window), not a code issue; the run comment itself states a new commit will not fix it. No PR-side change can clear it, so a maintainer needs to decide whether to override the block.
Sign in to comment.