Skip to content

fix: change RateLimiter trustProxy default to false#2024

Merged
bpamiri merged 1 commit intodevelopfrom
peter/security-ratelimiter-trustproxy-default
Apr 8, 2026
Merged

fix: change RateLimiter trustProxy default to false#2024
bpamiri merged 1 commit intodevelopfrom
peter/security-ratelimiter-trustproxy-default

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Apr 8, 2026

Summary

  • Changes trustProxy default from true to false in RateLimiter.cfc to prevent IP spoofing via X-Forwarded-For
  • Updates JSDoc to explain the security implications and when to enable
  • Adds RateLimiterSpec.cfc with 5 tests covering default behavior, explicit false, explicit true, spoofing prevention, and remoteAddr fallback

Security Impact

With trustProxy=true (previous default), any client could set X-Forwarded-For: <random-ip> to get a fresh rate limit bucket on every request, completely defeating rate limiting. This is a breaking change for apps that rely on the previous default and are behind a reverse proxy -- they will need to explicitly set trustProxy=true.

Test plan

  • CI passes on Lucee 7 + SQLite (new test file compiles and all specs pass)
  • Verify RateLimiterSpec tests cover: default=false, explicit false ignores XFF, explicit true uses XFF, spoofing blocked with default, remoteAddr priority

🤖 Generated with Claude Code

With trustProxy=true (previous default), any client could spoof their IP
via X-Forwarded-For header to get a fresh rate limit bucket per request,
completely bypassing rate limiting. Default to false so apps are secure
out of the box; users behind a trusted reverse proxy can opt in.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bpamiri bpamiri merged commit 3e99587 into develop Apr 8, 2026
4 of 6 checks passed
@bpamiri bpamiri deleted the peter/security-ratelimiter-trustproxy-default branch April 8, 2026 03:51
@bpamiri bpamiri mentioned this pull request Apr 16, 2026
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant