Skip to content

panel: Lock out failed sign-ins per caller behind a trusted proxy - #198

Merged
mattgd merged 2 commits into
mainfrom
devin/1794945713-panel-trust-proxy
Nov 18, 2026
Merged

mattgd merged 2 commits into
mainfrom
devin/1794945713-panel-trust-proxy

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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=true setting, off by default, tells the bridge it sits behind a proxy it can trust. The bridge then counts failed guesses by the last X-Forwarded-For entry, which is the address the proxy added itself, and ignores any entries the caller sent before it. When the setting is off, the bridge ignores X-Forwarded-For as before, because anyone reaching the bridge directly can write that header.

The Cloudflare Worker turns the setting on. It also overwrites X-Forwarded-For with Cloudflare's CF-Connecting-IP instead of appending to it, so the caller can't choose that value. .env.example and the README explain when to turn it on.

Proof

tests/panel-boundary.test.ts covers three cases through the guard's real address lookup:

  • with the setting on, one caller's lockout doesn't block another caller;
  • an address the caller adds ahead of the proxy's entry doesn't get them a fresh budget;
  • with the setting off, X-Forwarded-For is 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-IP request header.


Glasswing Gary opened this PR for Matt
Implemented in session Fix SCIM Bridge vulns
Review with Devin · Open in Devin Desktop


Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Prompt hidden (unlisted session)

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest change appears safe to merge.

Summary

The 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.

  • Panel sign-in lockouts now track callers behind trusted proxies.

No new actionable issues found.

Reviews (2) · Last reviewed commit: "test: Cover the Worker naming the caller..." · Reviewed by Greptile

Comment thread deploy/cloudflare/src/bridge.ts Resolved
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai review

@mattgd
mattgd merged commit 4820ba3 into main Nov 18, 2026
5 checks passed
@linear-code

linear-code Bot commented Nov 19, 2026

Copy link
Copy Markdown

VULN-4777

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant