URL Validation & Security
Plugged.in implements multiple layers of URL validation to prevent Server-Side Request Forgery (SSRF) attacks and ensure secure connections to MCP servers.Overview
URL validation occurs at multiple levels:- Input Validation: Syntax and format checking
- Domain Allowlisting: Approved domains only
- IP Range Blocking: Prevent internal network access
- Protocol Validation: HTTPS enforcement
- Port Restrictions: Limited to safe ports
Validation Layers
1. Input Validation
All URLs are validated using strict patterns:2. Domain Allowlisting
Only pre-approved domains are allowed for MCP server connections in production.
3. IP Range Blocking
Prevent access to internal networks:4. Protocol Validation
Enforce secure protocols:5. Port Restrictions
Limit connections to safe ports:Implementation
Complete Validation Function
URL Sanitization
Clean and normalize URLs:Security Headers
Content Security Policy
Prevent XSS and data injection:Additional Security Headers
SSRF Prevention
Request Interception
Intercept and validate all outgoing requests:Timeout Protection
Prevent hanging connections:Testing URL Validation
Unit Tests
Security Testing
Test SSRF prevention:Configuration
Environment Variables
Runtime Configuration
Best Practices
Always Validate User Input
Always Validate User Input
Never trust user-provided URLs. Always validate before use.
Use Allowlists Over Blocklists
Use Allowlists Over Blocklists
Explicitly allow known-good domains rather than blocking bad ones.
Validate After Redirects
Validate After Redirects
Re-validate URLs after following redirects.
Log Security Events
Log Security Events
Log all validation failures for security monitoring.
Regular Security Audits
Regular Security Audits
Periodically review and update validation rules.
Defense in Depth
Defense in Depth
Use multiple layers of validation, don’t rely on a single check.
Troubleshooting
Common Issues
Support
For security-related questions:- Security Issues: security@plugged.in
- Documentation: docs.plugged.in
- GitHub Issues: Report issues

