AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 49 Bitcoin

Refactor: Add btcpay.impersonation.canimpersonate permission (#7327)

Public commit record

What the developer wrote

Authored by Nicolas Dorier

70/100 · Adequate
Refactor: Add btcpay.impersonation.canimpersonate permission (#7327)
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
The short version

What changed, and why it matters

This commit refactors an existing "login code" feature into a new optional plugin called Impersonation. The feature lets an already-logged-in user generate a short-lived QR code/login code that can be used on another device to sign in as the same user. The commit adds a new permission, btcpay.impersonation.canimpersonate, and rules that try to limit impersonation: a user can impersonate themselves, and server admins can impersonate non-admin users but not other admins. The code is a refactor rather than a reported vulnerability fix, but it moves a sensitive authentication capability behind a plugin and a permission check, which is a security-relevant design change.

Recommended action

Review the new ImpersonationPermissionHandler logic for bypasses, especially around role checks and the scope parameter. Ensure the plugin is not enabled by default on production deployments and that server admins understand it grants the ability to sign in as non-admin users. Verify that login-code URLs cannot be leaked or replayed, and that the [AllowAnonymous] /login/code endpoint correctly rejects already-authenticated users attempting self-impersonation. Consider whether a 1-day persistent cookie is appropriate for impersonation sessions.

Security signals we found

01

New permission policy btcpay.impersonation.canimpersonate added

02

Impersonation capability moved from core into a plugin

03

Authorization check added before generating login codes

04

Rule added: admins cannot impersonate other admins

05

Rule added: non-admins cannot impersonate other users

06

Login code endpoint remains [AllowAnonymous] and rate-limited by remote address

07

Login code is single-use, 60-second expiration, 20 random bytes hex

08

Persistent 1-day cookie issued after successful login-code sign-in

Risk score

Why this scored 49/100

Our methodology →
Potential impact 12/30
Exploitability 10/25
Stealth signal 8/15
Affected reach 10/15
Confidence 6/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.