Add SSRF filter for HTTPX

Filtering in front of HTTPX calls is less secure, because it's vulnerable to
DNS rebinding. In addition to that it's also duplicate work, because all affected
callsites would have to make sure to "remember" SSRF filtering.

This SSRF filter is inspired by the original HTTPX SSRF Filter, but using our custom
IP address matcher that allows to configure safe IP addresses or ranges.
This commit is contained in:
Jan Sandbrink
2026-06-01 10:57:00 +02:00
parent 306173ad3f
commit 294611cc59
4 changed files with 137 additions and 3 deletions
+4 -3
View File
@@ -36,17 +36,18 @@ x-op-backend: &backend
target: develop
<<: [*image, *restart_policy]
environment:
DATABASE_URL: postgresql://${DB_USERNAME:-postgres}:${DB_PASSWORD:-postgres}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_DATABASE:-openproject}?pool=100
LOCAL_DEV_CHECK: "${LOCAL_DEV_CHECK:?The docker-compose file for OpenProject has moved to https://github.com/opf/openproject-docker-compose}"
RAILS_ENV: development
OPENPROJECT_CACHE__MEMCACHE__SERVER: cache:11211
OPENPROJECT_EDITION: ${OPENPROJECT_EDITION:-standard}
OPENPROJECT_RAILS__CACHE__STORE: file_store
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
DATABASE_URL: postgresql://${DB_USERNAME:-postgres}:${DB_PASSWORD:-postgres}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_DATABASE:-openproject}?pool=100
OPENPROJECT_EDITION: ${OPENPROJECT_EDITION:-standard}
OPENPROJECT_SSRF_PROTECTION_IP_ALLOWLIST: 0.0.0.0/0,::0/0 # disabling SSRF in dev to not interfere with local integrations (Nextcloud etc.)
OPENPROJECT_WEB_MAX__THREADS: 1
OPENPROJECT_WEB_MIN__THREADS: 1
OPENPROJECT_WEB_WORKERS: 0
PIDFILE: /home/dev/openproject/tmpfs/pids/server.pid
RAILS_ENV: development
volumes:
- ".:/home/dev/openproject"
- "opdata:/var/openproject/assets"