Skip to content

fix : add SSRF validation to repository analysis endpoint#2351

Open
tmdeveloper007 wants to merge 1 commit into
nisshchayarathi:mainfrom
tmdeveloper007:#2120
Open

fix : add SSRF validation to repository analysis endpoint#2351
tmdeveloper007 wants to merge 1 commit into
nisshchayarathi:mainfrom
tmdeveloper007:#2120

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Fixes #2120

Summary

The POST /analyze endpoint in app/analyze/route.ts accepted any string as a repository URL and forwarded it to the analysis pipeline without performing SSRF-safe URL validation. A user could submit URLs pointing to internal network resources (e.g. AWS metadata endpoint 169.254.169.254, private IPs like 192.168.1.1) which would be processed by the worker.

Changes

  • app/analyze/route.ts: Added validateSafeUrl() SSRF check after normalizeKnownRepoHttpUrl() validates the URL format. If the URL resolves to a private, loopback, or link-local IP, a 400 response is returned with the message: "Please enter a valid public GitHub, GitLab, or Bitbucket repository URL. Internal and private network addresses are not allowed."

Security Impact

Prevents SSRF attacks where a user submits an internal network URL through the repository analysis form. The same URL format validation already existed (via normalizeKnownRepoHttpUrl), but there was no check that the resolved IP was publicly reachable.

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

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.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@tmdeveloper007, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 30 minutes and 41 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9503a40f-9637-4ec6-983d-529dddcbbd11

📥 Commits

Reviewing files that changed from the base of the PR and between 9aa9b51 and c8fa420.

📒 Files selected for processing (1)
  • app/analyze/route.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

🎉 Thanks for your contribution, @tmdeveloper007!

Your PR has passed our automated GSSoC quality checks. Here's a quick summary:

Check Status
PR description ✅ Provided
PR title ✅ Meaningful
Linked issue ✅ Found
Change size ✅ Looks good (16 lines across 1 file(s))

A maintainer will review your PR soon. Please be patient and available for feedback. 💪

GSSoC'26 automation · Maintainer: @nisshchayarathi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSSoC'26 Part of GirlScript Summer of Code 2026

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security]: Repository URL field accepts malformed and potentially unsafe URLs without server-side validation

1 participant