fix: enforce rate limit on all webhook events regardless of installation ID#409
Conversation
|
@diksha78dev is attempting to deploy a commit to the codersogs-3057's projects Team on Vercel. A member of the Team first needs to authorize it. |
Ayush-Patel-56
left a comment
There was a problem hiding this comment.
x-forwarded-for is taken as the raw header value, but that's attacker-controlled in this exact threat model (leaked secret, forged requests) and can have multiple comma-separated hops. Need to confirm Vercel doesn't just append to it, and parse out the trusted IP rather than using the raw string. Also no test for the new fallback path.
|
@Ayush-Patel-56 Thanks for review.Relying on x-forwarded-for as a fallback leaves us vulnerable to IP spoofing since attackers can manipulate those headers. |
Ayush-Patel-56
left a comment
There was a problem hiding this comment.
Solid fix. LGTM. Thanks!
Summary
Fixed a rate limiting bypass vulnerability where GitHub webhooks lacking an
installation.id(such asmetaorsecurity_advisoryevents) completely skipped the rate limiter.Type of Change
Related Issue
Closes #391
What was changed?
if (installationId)that skipped rate-limiting.x-forwarded-forheader for events that do not contain aninstallation.id.Screenshots
N/A
Checklist
npm run dev&npm run test)