Skip to content

fix(docker): harden default SSRF proxy egress#36332

Draft
laipz8200 wants to merge 1 commit into
mainfrom
laipz8200/harden-docker-ssrf-proxy
Draft

fix(docker): harden default SSRF proxy egress#36332
laipz8200 wants to merge 1 commit into
mainfrom
laipz8200/harden-docker-ssrf-proxy

Conversation

@laipz8200
Copy link
Copy Markdown
Member

Summary

  • Harden the Docker Compose SSRF proxy defaults by denying loopback, private, CGN, link-local, ULA, multicast, reserved, and cloud metadata target networks before general egress is allowed.
  • Stop relying on the Ubuntu Squid image's packaged conf.d access rules so allow localnet cannot bypass Dify's policy.
  • Preserve the sandbox reverse proxy path and add explicit SSRF_PROXY_ALLOW_PRIVATE_IPS / SSRF_PROXY_ALLOW_PRIVATE_DOMAINS escape hatches for trusted private-network deployments.

Screenshots

N/A

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've updated the documentation accordingly.

Block private, loopback, link-local, multicast, reserved, and metadata target networks in the Docker Compose SSRF proxy while preserving public egress and sandbox reverse proxy access.

Add explicit private IP and domain allowlist environment variables for deployments that need trusted private-network access.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.94%. Comparing base (06ea0f7) to head (a7726f0).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #36332   +/-   ##
=======================================
  Coverage   85.94%   85.94%           
=======================================
  Files        4454     4454           
  Lines      211374   211374           
  Branches    39507    39507           
=======================================
  Hits       181667   181667           
  Misses      26499    26499           
  Partials     3208     3208           
Flag Coverage Δ
api 85.46% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant