You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Security] Express trust proxy is not configured, so per-IP rate limiting and audit-log IPs use the proxy address #1069
app.ts never sets trust proxy, so behind a load balancer every request looks like it came from the proxy, and that quietly guts our per-IP rate limiting.
The global limiter plus ipLoginRateLimiter, challengeRateLimiter, and verifyRateLimiter all key on req.ip, and the auth-failure and audit logs record req.ip too. Behind a reverse proxy, req.ip is the proxy socket address, not the client. Production runs secure cookies and HSTS and we have a staging docker deploy, so this is the real deployment shape. Two consequences: brute-force protection collapses into one shared bucket for everyone, and every audit and auth log records the wrong client IP, so the logs are useless for forensics. express-rate-limit also throws X-Forwarded-For validation warnings in this state. The fix is small but it's a genuine security-control regression.
What the fix has to hold to
Drive trust proxy from an env var (a proxy hop count, say) with a safe local-dev default. Don't hardcode true.
Once it's set, req.ip resolves to the real client and rate-limit buckets are per-client.
Don't touch rate-limit thresholds or windows.
Document the setting with the other deployment env vars.
Done when
trust proxy comes from an env var (e.g. proxy hop count) with a safe default for local dev.
With a simulated X-Forwarded-For, req.ip resolves to the client and rate-limit buckets are per client.
The setting is documented next to the other deployment env vars.
A test confirms per-client IP resolution behind a simulated proxy; lint/format green, CI passes.
Where to start
Add the trust proxy config in backend/src/app.ts, then confirm backend/src/middleware/rateLimiter.ts and backend/src/middleware/auditLog.ts now see the right req.ip, and document the env var. Out of scope: changing thresholds or windows. Small config fix, 1-2 days.
Congratulations, @abdulqoyumadegoke! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.
🧑💻 @abdulqoyumadegoke: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
Activity
abdulqoyumadegoke commentedon Aug 30, 2026
@abdulqoyumadegoke has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @abdulqoyumadegoke to this issue.
codewithzubair07 commentedon Aug 30, 2026
@codewithzubair07 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @codewithzubair07 to this issue.
drips-wave commentedon Aug 30, 2026
Congratulations, @abdulqoyumadegoke! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.
🧑💻 @abdulqoyumadegoke: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊