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

Apply csrf protection on all UI**Controller globally (#7199)

Public commit record

What the developer wrote

Authored by Nicolas Dorier

58/100 · Thin
Apply csrf protection on all UI**Controller globally (#7199)
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
The short version

What changed, and why it matters

This commit strengthens BTCPay Server's defenses against cross-site request forgery (CSRF) attacks. Instead of manually adding CSRF protection to each web UI controller, the team added a single global filter that automatically checks CSRF tokens for all UI controllers. They also converted several API (Greenfield) controllers from the web-style Controller base class to the API-style ControllerBase so the global filter does not accidentally apply CSRF checks to API endpoints. A few endpoints that legitimately need to skip CSRF (such as the error page and invoice state changes) are explicitly marked to ignore it. The change is a security hardening patch, but the commit message and diff alone do not prove a specific exploitable vulnerability existed before.

Recommended action

Treat this as a security hardening change and include it in the next release. Review any custom or third-party UI controllers not following the UI** naming convention to ensure they are covered by the new global filter, and verify that [IgnoreAntiforgeryToken] is only applied where truly necessary. Run regression tests on Greenfield API endpoints to confirm they remain unaffected by antiforgery validation.

Security signals we found

01

Global CSRF/antiforgery enforcement added for UI controllers

02

Removal of per-controller [AutoValidateAntiforgeryToken] attributes

03

API controllers moved to ControllerBase to avoid UI antiforgery policy

04

Explicit [IgnoreAntiforgeryToken] on UIErrorController and ChangeInvoiceState

05

CSRF validation failure message surfaced through UIErrorController.ErrorDetailsKey

Risk score

Why this scored 83/100

Our methodology →
Potential impact 25/30
Exploitability 20/25
Stealth signal 12/15
Affected reach 14/15
Confidence 8/10
Evidence quality 4/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.