Repository navigation
panel: Lock out failed sign-ins per caller behind a trusted proxy - #198
Merged
Merged
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
Prompt hidden (unlisted session) |
[Medium impact] The latest change appears safe to merge. SummaryThe PR makes failed panel sign-ins count per caller behind a trusted proxy. The latest change closes the previously reported gap in Cloudflare test coverage.
No new actionable issues found. Reviews (2) · Last reviewed commit: "test: Cover the Worker naming the caller..." · Reviewed by Greptile |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
@greptileai review |
mattgd
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What was wrong. Since #194, 10 wrong panel passwords from one address lock that address out for 15 minutes. Behind a reverse proxy, every request comes from the proxy's address. So anyone who could reach the panel could type 10 wrong passwords and lock out every operator, including people with the right password. The Cloudflare adapter always works this way: the Worker in front of the container is the only peer the container ever sees.
How it's fixed. A new
PANEL_TRUST_PROXY=truesetting, off by default, tells the bridge it sits behind a proxy it can trust. The bridge then counts failed guesses by the lastX-Forwarded-Forentry, which is the address the proxy added itself, and ignores any entries the caller sent before it. When the setting is off, the bridge ignoresX-Forwarded-Foras before, because anyone reaching the bridge directly can write that header.The Cloudflare Worker turns the setting on. It also overwrites
X-Forwarded-Forwith Cloudflare'sCF-Connecting-IPinstead of appending to it, so the caller can't choose that value..env.exampleand the README explain when to turn it on.Proof
tests/panel-boundary.test.tscovers three cases through the guard's real address lookup:X-Forwarded-Foris ignored.With the source changes stashed, the first test fails (
1 failed | 9 passed). With them, all 10 pass, and the full suite (1192 tests), typecheck and build pass.Not proven
I didn't deploy the Cloudflare Worker change. It uses the documented
CF-Connecting-IPrequest header.Implemented in session Fix SCIM Bridge vulns
Review with Devin · Open in Devin Desktop