diff --git a/CLAUDE.md b/CLAUDE.md index 55a4143..4928d5a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -64,6 +64,10 @@ curl "http://host/api?key=your-secret-key&url=https://example.com" Set `BLOCK_PRIVATE_IPS=true` to reject requests to LAN, loopback, and cloud metadata IPs. Recommended when hosting publicly. Default is off (allows local/LAN addresses). +Note: DNS rebinding attacks can bypass this protection (attacker-controlled DNS can return a public IP +during validation and a private IP when Chrome actually connects). Full protection requires a network-level +egress firewall. + ## Caveats - `web/index.php` has a `var_dump($cmd)` debug statement left in `http2pic.class.php:181` - remove before shipping. diff --git a/docker/start.sh b/docker/start.sh index 49cdf9f..a27f8f6 100755 --- a/docker/start.sh +++ b/docker/start.sh @@ -20,6 +20,7 @@ _buildConfig() { *) block_private=false ;; esac api_key="${API_KEY:-}" + api_key="${api_key//\\/}" api_key="${api_key//\'/}" echo " 3840 || $vpParts[1] > 2160) { header('HTTP/1.0 400 Bad Request'); - echo 'Viewport exceeds maximum (3840x2160)'; + echo 'Viewport dimensions must be between 1x1 and 3840x2160'; exit; }