Visitar URL original
[INFRA-1240] fix(security): trust only private ranges in the AIO proxy by sriramveeraghanta · Pull Request #10136 · makeplane/plane · GitHub
Skip to content

[INFRA-1240] fix(security): trust only private ranges in the AIO proxy - #10136

Open
sriramveeraghanta wants to merge 1 commit into
previewfrom
fix/infra-1240-aio-trusted-proxies-default
Open

sriramveeraghanta wants to merge 1 commit into
previewfrom
fix/infra-1240-aio-trusted-proxies-default

Conversation

@sriramveeraghanta

@sriramveeraghanta sriramveeraghanta commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Description

The all-in-one (AIO) image's Caddy config trusted forwarded headers from 0.0.0.0/0. Any client's own X-Forwarded-For therefore reached the bundled API unchanged. The API uses that header for its per-IP throttles on the auth endpoints and for the audit IP (get_client_ip), so on a default AIO install a client could pick the IP the API saw.

  • apps/proxy/Caddyfile.aio.ce: the default for TRUSTED_PROXIES is now private_ranges, the same value apps/web/caddy/Caddyfile and apps/admin/caddy/Caddyfile already use. Caddy replaces the header from any client outside the trusted ranges with the real client IP before proxying.
  • deployments/aio/community/README.md: documents TRUSTED_PROXIES for operators behind a load balancer or CDN.

Behavior change: AIO installs behind a load balancer or CDN on public IPs will see the load balancer's IP as the client until they set TRUSTED_PROXIES (e.g. -e TRUSTED_PROXIES="private_ranges 203.0.113.0/24"). Until then, all users share one auth rate-limit bucket. This needs a release note.

Not changed:

  • TRUSTED_PROXIES is not added to variables.env. start.sh exports plane.env over the container environment, so adding it there would silently override a -e TRUSTED_PROXIES=... flag.
  • The standard proxy (Caddyfile.ce, CLI compose) keeps its 0.0.0.0/0 default, which INFRA-1189 kept on purpose.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

Checked with the caddy:2 image (v2.11.4):

  • caddy adapt on the new config: when unset, trusted_proxies resolves to the private ranges. TRUSTED_PROXIES=203.0.113.0/24 and TRUSTED_PROXIES="private_ranges 203.0.113.0/24" both resolve as expected.
  • Sent a request with a fake X-Forwarded-For: 6.6.6.6 to /api/*, routed to an echo backend on :3004. With the old default (0.0.0.0/0) the backend got 6.6.6.6, 127.0.0.1. From an untrusted client it got 127.0.0.1 only.

Suggested on a built AIO image:

  • Run the container with default settings, send a sign-in request from outside the host with a made-up X-Forwarded-For, and confirm the API logs and rate-limits the real client IP.
  • Run it with -e TRUSTED_PROXIES="<lb range>" behind a load balancer and confirm the real client IP still reaches the API.

Known limit: where Docker's userland proxy forwards the traffic (Docker Desktop, some IPv6 setups), clients arrive from a private gateway IP and are still trusted. Standard Linux port mapping keeps the real client IP.

References

  • INFRA-1240
  • Related: INFRA-1189 (configurable NUM_PROXIES / TRUSTED_PROXIES for the CLI compose)

Created with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • The default trusted proxy configuration now uses private network ranges instead of trusting all IP addresses. Explicitly configured trusted proxy values continue to take precedence.
  • Documentation
    • Added guidance on configuring trusted proxies, including how forwarded client IPs affect rate limiting and why trusting all IP addresses is not recommended.

…y by default

The AIO Caddyfile trusted forwarded headers from 0.0.0.0/0, so a client's
own X-Forwarded-For reached the API and keyed its per-IP throttles and
audit IP. Default TRUSTED_PROXIES to private_ranges, matching the web and
admin Caddyfiles, and document the override for load balancers and CDNs.
Copilot AI balanced review requested due to automatic review settings October 28, 2026 20:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@makeplane

makeplane Bot commented Oct 28, 2026

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7b85a7c1-dab4-45d6-b847-8ebe22999a3a
Commits

Reviewing files that changed from the base of the PR and between 9d10be3 and 56df8c5.

Files selected for processing: 2
  • apps/proxy/Caddyfile.aio.ce
  • deployments/aio/community/README.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The AIO proxy now defaults TRUSTED_PROXIES to private_ranges instead of 0.0.0.0/0. Explicit environment values still override the default. The community deployment README documents the setting and warns about trusting all IPv4 addresses.

Changes: Trusted proxy configuration

Layer / File(s) Summary
Proxy default and configuration guidance
apps/proxy/Caddyfile.aio.ce, deployments/aio/community/README.md
The AIO proxy defaults to private_ranges while preserving an explicitly configured TRUSTED_PROXIES value. The README describes proxy ranges, their role in rate limiting, and the risk of trusting 0.0.0.0/0.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • makeplane/plane#9525: This changes the AIO proxy default requested in the issue; production environment wiring remains outside this change.
  • makeplane/plane#9913: Restricting trusted proxy ranges addresses the reported use of attacker-controlled X-Forwarded-For values for rate-limit bypass.

Suggested labels: 🛡️security

Suggested reviewers: mguptahub, pablohashescobar

Merge Risk: Minimal · up to 56df8

The AIO proxy now defaults to trusting private ranges. Operators behind public load balancers or CDNs must configure their proxy ranges as documented. No actionable merge-blocking issue was established.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main security change: restricting trusted proxies to private ranges in the AIO proxy.
Description check Passed The description is complete and relevant. It explains the security issue, implementation, behavior change, configuration guidance, test scenarios, known limitation, change type, and references.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

2 participants