Skip to content

panel: Refuse framing and throttle failed sign-in guesses - #194

Merged
mattgd merged 7 commits into
mainfrom
devin/1794582005-panel-framing-throttle
Nov 17, 2026
Merged

mattgd merged 7 commits into
mainfrom
devin/1794582005-panel-framing-throttle

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

The problem

Two weaknesses in the operator control panel:

  • Clickjacking. Any website could load the panel in an invisible frame. It could then trick a signed-in operator into clicking "save" on a change they didn't intend, such as pointing a directory's endpoint at the attacker's server. The stored bearer tokens would then go to that server.
  • Password guessing. Nothing limited failed sign-ins, so anyone who could reach the panel could guess the password as fast as the server answered.

The fix

  • Every response now tells browsers never to show the panel inside a frame on another site (Content-Security-Policy: frame-ancestors 'none' and X-Frame-Options: DENY).
  • After 10 wrong passwords from one address within 15 minutes, that address is locked out for the rest of the 15 minutes. During the lockout even the right password gets 429 Too Many Requests. Other addresses aren't affected.

I deliberately didn't add a cap across all addresses. It would let anyone lock the real operator out. An attacker who rotates addresses is still up against the password itself.

Proof

I ran the server with a password set and sent 11 wrong guesses, then the right one. The first 10 got 401, then 429, and every response carried the anti-framing headers. New tests in tests/panel-boundary.test.ts check that:

  • 200 wrong guesses from other addresses don't lock out the operator;
  • 25 simultaneous wrong guesses still produce exactly 10 attempts before the lockout;
  • correct sign-ins sent at the same moment are never blocked by mistake.

These tests fail without the change, and the full suite passes.

Not proven

  • The counters live in each process. In a deployment with several replicas, each replica has its own 10-guess budget.
  • Behind a shared reverse proxy, every caller shares the proxy's address. Ten wrong guesses then lock out everyone for 15 minutes. Fixing this needs a trusted-proxy setting, which I've left for a follow-up.

🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

Every response now carries frame-ancestors 'none' and X-Frame-Options:
DENY, so a page cannot frame the panel and redress an operator's clicks
into a repointed endpoint. Failed Basic-auth guesses are counted per peer
and in total over a 15-minute window; once either cap trips the panel
answers 429 until the window ends.

Co-Authored-By: matt.dzwonczyk <mattdzwonczyk@gmail.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

Copy link
Copy Markdown
Contributor Author

@greptileai review

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge within its stated deployment limits.

Summary

The PR blocks framing and limits failed panel sign-ins to 10 per connecting address in a 15-minute window.

  • Bridge responses tell browsers not to display them in frames.
  • Panel sign-ins allow ten wrong guesses per peer every 15 minutes.

Both earlier findings are addressed. No new actionable issues found. In the PR description, devin-ai-integration[bot] accepts separate budgets per replica and shared lockouts behind reverse proxies, deferring trusted-proxy support. They intentionally omit a shared limit across addresses to prevent attackers from locking everyone out.

Reviews (7) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

greptile-apps[bot]

This comment was marked as resolved.

The failure was recorded only after the asynchronous password check, so a
concurrent burst could all pass the throttle first. Each guess now takes
its slot up front and gives it back only if the password was right.

Co-Authored-By: matt.dzwonczyk <mattdzwonczyk@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai review

greptile-apps[bot]

This comment was marked as resolved.

Counting each guess as a failure before checking it closed the burst gap
but let overlapping correct sign-ins trip the limit. Checks now run
through a per-throttle queue, so the counters are exact when each request
is admitted and only a wrong password is ever counted.

Co-Authored-By: matt.dzwonczyk <mattdzwonczyk@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai review

…rator out

A cap shared by every source let anyone who can reach the panel keep it
answering 429 to the operator's correct password. Failed guesses are now
limited per connecting peer only.

Co-Authored-By: matt.dzwonczyk <mattdzwonczyk@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai review

@devin-ai-integration

devin-ai-integration Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Devin Review

🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

@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 found 1 finding. It is left for you to triage below.

View findings in Devin Review · Follow Devin's work

Devin Review

Comment thread server/panel-boundary.ts Resolved
Co-Authored-By: matt.dzwonczyk <mattdzwonczyk@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai review

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai review

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai review

@mattgd
mattgd merged commit d0dea7b into main Nov 17, 2026
5 checks passed
@linear-code

linear-code Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

VULN-4777

VULN-3951

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