What happened?
src/app/api/webhooks/github/route.ts only applies rate limiting when the incoming payload has an installation field:
const installationId = payload.installation?.id;
...
if (installationId) {
// rate limit applied here
}
Several legitimate GitHub webhook event types don't carry an installation object at all (for example meta, security_advisory, github_app_authorization). Signature verification still runs first and is solid, so this isn't an auth bypass, but any event type that lacks installation skips the rate limiter entirely after that check passes, with no ceiling on how often it can be processed.
Steps to Reproduce
- Send a validly signed webhook payload for an event type with no
installation field
- Repeat it as many times as you want
- None of them get rate limited, unlike events that do carry an installation id
Expected Behavior
Rate limiting should apply to every webhook event regardless of payload shape, maybe keyed by something else (delivery id, source IP, event type) when there's no installation id to key on.
Where does this occur?
API (GitHub webhooks)
Additional Context
Low likelihood of abuse since it still requires a valid signature, but it's an inconsistency worth closing, especially since a leaked or rotated webhook secret would otherwise have no rate ceiling on this path.
What happened?
src/app/api/webhooks/github/route.tsonly applies rate limiting when the incoming payload has aninstallationfield:Several legitimate GitHub webhook event types don't carry an
installationobject at all (for examplemeta,security_advisory,github_app_authorization). Signature verification still runs first and is solid, so this isn't an auth bypass, but any event type that lacksinstallationskips the rate limiter entirely after that check passes, with no ceiling on how often it can be processed.Steps to Reproduce
installationfieldExpected Behavior
Rate limiting should apply to every webhook event regardless of payload shape, maybe keyed by something else (delivery id, source IP, event type) when there's no installation id to key on.
Where does this occur?
API (GitHub webhooks)
Additional Context
Low likelihood of abuse since it still requires a valid signature, but it's an inconsistency worth closing, especially since a leaked or rotated webhook secret would otherwise have no rate ceiling on this path.