fix(security): add SSRF protection to URL validation#991
fix(security): add SSRF protection to URL validation#991bryankthompson wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
- Add isPrivateIP() function to detect private/internal IPs - Block requests to localhost, private ranges, link-local addresses - Validate URLs before making HTTP requests - Prevent SSRF attacks through URL parameters 🤖 Generated with [Claude Code](https://claude.com/claude-code)
979c121 to
b0bea2b
Compare
|
Thanks for the contribution and for thinking about security! A few considerations after review:
If you believe there's a specific exploitable vulnerability, please report it through HackerOne with reproduction steps so the security team can assess it properly. Thanks again! This comment was drafted with assistance from Claude (AI). |
|
Closing per the discussion above. If there's a specific exploitable vulnerability, please report via HackerOne. |
Summary
Adds SSRF (Server-Side Request Forgery) protection to URL validation by blocking requests to private/internal IP addresses.
Changes
isPrivateHostname()helper with comprehensive private IP detection:validateRedirectUrl()to block private IPs by defaultallowPrivateIPsoption for backward compatibilityisPrivateUrl()utility function for checking without throwingSecurity Impact
Test plan
npm run build)allowPrivateIPs: trueallows private IPs for backward compatibility🤖 Generated with Claude Code