Skip to content

Security

The CORS Proxy is designed with security as a core principle. This page documents the security features, threat model, and configuration options for hardening your deployment.

FeaturePurpose
SSRF ProtectionBlock requests to private networks and cloud metadata
Domain AllowlistingLimit which domains can be proxied
Origin ValidationRestrict which websites can use the proxy
Rate LimitingPrevent abuse and DDoS
HTTPS EnforcementPrevent man-in-the-middle attacks
No LoggingProtect user privacy

Server-Side Request Forgery (SSRF) attacks trick a server into making requests to internal resources. The CORS Proxy blocks all requests to private networks and sensitive endpoints.

RangeDescription
127.0.0.0/8Localhost/loopback
10.0.0.0/8Private network (Class A)
172.16.0.0/12Private network (Class B)
192.168.0.0/16Private network (Class C)
169.254.0.0/16Link-local (AWS/GCP metadata)
::1IPv6 localhost
fe80::/10IPv6 link-local
fc00::/7IPv6 unique local
  • localhost
  • 0.0.0.0
  • metadata.google.internal (GCP)
  • Kubernetes internal services
# Cloud metadata endpoints (credential theft)
https://cors-proxy.pondpilot.io/proxy?url=http://169.254.169.254/latest/meta-data/
# Internal services
https://cors-proxy.pondpilot.io/proxy?url=http://127.0.0.1:8080/admin
# Private network scanning
https://cors-proxy.pondpilot.io/proxy?url=http://192.168.1.1/router-config

All of these return 403 Forbidden with SSRF protection error.

The proxy blocks redirects to prevent SSRF bypass via redirect chains. A URL that redirects to a private IP is blocked even if the initial URL appears safe.

By default, the proxy only allows requests to a curated list of safe domains. This prevents the proxy from being used as an open proxy for malicious purposes.

# Cloud Storage
*.s3.amazonaws.com
*.s3.*.amazonaws.com
*.cloudfront.net
*.storage.googleapis.com
*.blob.core.windows.net
# Code Hosting
*.github.io
*.githubusercontent.com
# Public Data
data.gov
data.gouv.fr
blobs.duckdb.org
*.duckdb.org

To allow additional domains, set the ALLOWED_DOMAINS environment variable:

Terminal window
# Allow specific domains
ALLOWED_DOMAINS="api.yourcompany.com,data.yourcompany.com"
# Allow wildcard subdomains
ALLOWED_DOMAINS="*.yourcompany.com,*.partner.com"
# Combine with defaults (not automatic, you must list all)
ALLOWED_DOMAINS="*.s3.amazonaws.com,*.yourcompany.com"

Wildcards match only one subdomain level for security:

PatternMatchesDoes Not Match
*.example.comapi.example.commalicious.api.example.com

This prevents attackers from registering deep subdomains to bypass restrictions.

The proxy validates the Origin header to ensure only authorized websites can use it.

Terminal window
# Allow specific origins
ALLOWED_ORIGINS="https://app.pondpilot.io,https://yourapp.com"
# Allow localhost for development
ALLOWED_ORIGINS="https://app.pondpilot.io,http://localhost:5173"

Requests without a valid Origin header or from non-allowed origins are rejected.

Rate limiting prevents abuse and protects against DDoS attacks.

Terminal window
# 100 requests per minute per IP
RATE_LIMIT_REQUESTS=100
RATE_LIMIT_WINDOW_MS=60000
SettingDefault
Requests per window60
Window duration60 seconds (1 minute)

Rate-limited requests receive 429 Too Many Requests.

In production mode (NODE_ENV=production), the proxy only allows HTTPS target URLs. This prevents:

  • Man-in-the-middle attacks on proxied data
  • Accidental exposure of sensitive data over unencrypted connections
Terminal window
# Only HTTPS allowed (default in production)
HTTPS_ONLY=true
# Allow HTTP (development only, not recommended)
HTTPS_ONLY=false

By default, the proxy never forwards authentication headers:

  • Authorization headers are stripped
  • Cookies are not forwarded
  • API keys in headers are removed

For corporate environments where you trust both the client and data source, you can enable credential forwarding:

Terminal window
ALLOW_CREDENTIALS=true

Even with credentials enabled:

  • Upstream Set-Cookie headers are blocked
  • The proxy never stores or logs credentials

The proxy does not log:

  • Request URLs
  • Request/response bodies
  • User IP addresses (beyond rate limiting)
  • Any personally identifiable information

This is enforced at the code level, not just policy.

ThreatMitigation
SSRF attacksPrivate IP blocking, domain allowlist, redirect blocking
DNS rebindingDomain validation before fetch, redirect blocking
Unauthorized proxy useOrigin validation
DDoS/abuseRate limiting
Bandwidth exhaustionFile size limits, request timeouts
Open proxy abuseDomain allowlist, origin validation
Credential theftNo auth header forwarding by default
Data exfiltrationRead-only operations, domain allowlist
Privacy violationsNo logging policy
ThreatWhy
Malicious content from allowed domainsThe proxy is transparent; it doesn’t scan content
Allowed origin misuseIf an allowed origin is compromised, it can use the proxy
Physical server compromiseStandard infrastructure security applies

Before deploying to production, verify:

  • NODE_ENV=production is set
  • HTTPS_ONLY=true (or using HTTPS reverse proxy)
  • ALLOWED_ORIGINS contains only your domains (no *)
  • ALLOWED_DOMAINS is appropriate for your use case
  • Rate limits are configured appropriately
  • Firewall blocks direct access to internal networks
  • Health monitoring is configured
  • HTTPS termination is properly configured
Terminal window
# Should return 403
curl "http://localhost:3000/proxy?url=http://169.254.169.254/latest/" \
-H "Origin: http://localhost:5173"
curl "http://localhost:3000/proxy?url=http://127.0.0.1:8080/" \
-H "Origin: http://localhost:5173"
Terminal window
# Should work (default allowed domain)
curl "http://localhost:3000/proxy?url=https://blobs.duckdb.org/test" \
-H "Origin: http://localhost:5173"
# Should return 403 (not in allowlist)
curl "http://localhost:3000/proxy?url=https://evil.com/malware" \
-H "Origin: http://localhost:5173"
Terminal window
# Should work with allowed origin
curl "http://localhost:3000/proxy?url=https://blobs.duckdb.org/test" \
-H "Origin: http://localhost:5173"
# Should return 403 with unauthorized origin
curl "http://localhost:3000/proxy?url=https://blobs.duckdb.org/test" \
-H "Origin: https://malicious-site.com"

If you discover a security vulnerability, please report it responsibly:

  1. Do not open a public GitHub issue
  2. Email security concerns to the maintainers
  3. Allow time for a fix before public disclosure

See the Security Policy for details.