fix: return 404 instead of 403 for unauthorized annotation access to prevent resource enumeration#2595
Conversation
|
Someone is attempting to deploy a commit to the Nisshchaya's projects Team on Vercel. A member of the Team first needs to authorize it. |
🎉 Thanks for your contribution, @tmdeveloper007!Your PR has passed our automated GSSoC quality checks. Here's a quick summary:
A maintainer will review your PR soon. Please be patient and available for feedback. 💪 GSSoC'26 automation · Maintainer: @nisshchayarathi |
|
Warning Review limit reached
Next review available in: 11 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Cherry-picked from upstream fix branch: - lib/services/bitbucketService.ts: String() wrapping - lib/services/gitlabService.ts: String() wrapping - src/components/repository/ContributorIssueRecommendations.tsx: stub - src/components/repository/RepositoryInsights.tsx: remove invalid repository prop - src/components/visualizations/CodeDependencyGraph.tsx: remove graphData from dependency array
…dpoints, 403-to-404 in annotations, and clear permission errors
f749ffd to
a0ad604
Compare
🎉 Thanks for your contribution, @tmdeveloper007!Your PR has passed our automated GSSoC quality checks. Here's a quick summary:
A maintainer will review your PR soon. Please be patient and available for feedback. 💪 GSSoC'26 automation · Maintainer: @nisshchayarathi |
Summary
The annotation API routes were returning
403 Forbiddenwhen a user tried to access annotations belonging to a different user. This inadvertently confirmed the existence of those resources, enabling enumeration attacks.Security Fix
Changed the unauthorized access response from
403 Forbiddento404 Not Foundin:app/api/annotations/[id]/route.ts(PATCH and DELETE handlers)app/api/annotations/route.ts(GET handler)This prevents an attacker from determining whether a resource ID is valid by observing different HTTP status codes.
Changes
app/api/annotations/[id]/route.ts: ReturnNextResponse.json({error: 'Not found'}, {status: 404})instead of403app/api/annotations/route.ts: Return404instead of403for unauthorized repository accessRelated Issue
Fixes #276