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

[Greenfield] Subscription API (#7022)

Public commit record

What the developer wrote

Authored by Nicolas Dorier

43/100 · Thin
[Greenfield] Subscription API (#7022)
✓ Descriptive subject✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
The short version

What changed, and why it matters

This commit introduces a new Greenfield (REST) Subscription API to BTCPay Server, allowing stores to manage subscription offerings, plans, subscribers, credits, and checkout sessions programmatically. It also refactors existing subscription internals, adds new permissions, and makes small related fixes such as handling empty URL paths and adding a null check for invoice IDs. There is no explicit security bug in the diff, but the large new attack surface and a few design choices warrant careful review.

Recommended action

Treat this as a significant feature addition requiring security review rather than an immediate vulnerability. Review authorization policy enforcement on all new endpoints, validate that anonymous endpoints cannot be abused to enumerate or mutate subscriber data, ensure CustomerSelector parsing cannot be confused to access another customer's records, and confirm that UpdateCredit with AllowOverdraft and arbitrary currency is intended. Run integration tests and consider a focused audit of the new subscription API before release.

Security signals we found

01

New large API surface added (offerings, plans, subscribers, credits, checkouts, portal sessions)

02

New permissions CanManageSubscribers and CanCreditSubscribers introduced; CanModifyOfferings grants both implicitly

03

AllowAnonymous endpoints for plan-checkout and subscriber-portal create unauthenticated resources by ID

04

CustomerSelector parsing uses regex and string splitting; edge cases like 'cust_test@ggwg.com' are parsed as email identity

05

UpdateCredit endpoint allows arbitrary credit/charge adjustments with optional overdraft

06

Plan checkout creation accepts metadata JObjects and SuccessRedirectLink; redirect URL is validated with Uri.IsWellFormedUriString

07

GreenfieldAuthorizationHandler now reads storeId from context.Resource as fallback, changing authorization context behavior

08

LocalGreenfieldAuthorizationHandler removed; local Greenfield auth now flows through main handler

Risk score

Why this scored 37/100

Our methodology →
Potential impact 8/30
Exploitability 7/25
Stealth signal 5/15
Affected reach 8/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.