What changed, and why it matters
This commit adds [BindNever] attributes to several properties in view models. In ASP.NET Core, [BindNever] tells the framework not to populate those properties from incoming HTTP request data. Without it, an attacker could potentially submit crafted form or query data to overwrite values that the application intended to set internally, such as invoice lists, report results, or transaction lists. This is a hardening change that reduces the attack surface for model-binding abuse, but the commit does not describe a specific vulnerability or exploit.
Treat this as a security-hardening improvement. Review whether any other view models in the project expose settable, server-populated properties without [BindNever] or similar binding restrictions. Consider whether the affected properties were previously reachable through request parameters and whether any abuse scenarios (e.g., altering displayed invoice lists, report results, or transaction data via crafted requests) were possible. No immediate emergency response is indicated by the diff alone.
Security signals we found
Use of [BindNever] to prevent model binding of internally-populated properties
Hardening against over-posting / mass assignment patterns
Properties affected include report results, invoice lists, transaction lists, and URL templates
No explicit vulnerability or CVE referenced in commit metadata
Evidence from the diff
The patch decorates server-side populated properties with [BindNever] in three view models: InvoicesModel.Invoices, StoreReportsViewModel (InvoiceTemplateUrl, ExplorerTemplateUrls, AvailableViews, Result), and ListTransactionsViewModel (Labels, Transactions). These properties are typically populated by the controller/service layer and rendered in views. By default, ASP.NET Core model binding attempts to bind public settable properties from request data (form, query, route, body). [BindNever] prevents this, mitigating risks such as mass assignment or over-posting where a malicious request could influence internal state. The patch is additive and hardening in nature; it does not by itself prove an exploitable vulnerability existed.
Changed components
BTCPayServer/Models/InvoicingModels/InvoicesModel.csBTCPayServer/Models/StoreReportsViewModels/StoreReportsViewModel.csBTCPayServer/Plugins/Wallets/Views/ViewModels/ListTransactionsViewModel.csInspect captured patch +10 / −0
### BTCPayServer/Models/InvoicingModels/InvoicesModel.cs
@@ -1,12 +1,14 @@
using System;
using System.Collections.Generic;
using BTCPayServer.Services.Invoices;
+using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
namespace BTCPayServer.Models.InvoicingModels
{
public class InvoicesModel : BasePagingViewModel
{
+ [BindNever]
public List<InvoiceModel> Invoices { get; set; } = new ();
public override int CurrentPageCount => Invoices.Count;
public List<InvoiceAppModel> Apps { get; set; }
### BTCPayServer/Models/StoreReportsViewModels/StoreReportsViewModel.cs
@@ -2,14 +2,19 @@
using BTCPayServer.Client.Models;
using BTCPayServer.Controllers.GreenField;
using BTCPayServer.Payments;
+using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace BTCPayServer.Models.StoreReportsViewModels;
public class StoreReportsViewModel : BasePagingViewModel
{
+ [BindNever]
public string InvoiceTemplateUrl { get; set; } = "";
+ [BindNever]
public Dictionary<PaymentMethodId,string> ExplorerTemplateUrls { get; set; } = [];
+ [BindNever]
public List<string> AvailableViews { get; set; } = [];
+ [BindNever]
public StoreReportResponse Result { get; set; }
public string ViewName { get; set; }
public override int CurrentPageCount => Result?.Data?.Count ?? 0;
### BTCPayServer/Plugins/Wallets/Views/ViewModels/ListTransactionsViewModel.cs
@@ -5,6 +5,7 @@
using BTCPayServer.Models;
using BTCPayServer.Services.Invoices;
using BTCPayServer.Services.Wallets;
+using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace BTCPayServer.Plugins.Wallets.Views.ViewModels
{
@@ -28,7 +29,9 @@ public class TransactionViewModel
public string InvoiceId { get; set; }
public TransactionHistoryLine HistoryLine { get; set; }
}
+ [BindNever]
public HashSet<LabelSelectorItemViewModel> Labels { get; set; } = new();
+ [BindNever]
public List<TransactionViewModel> Transactions { get; set; } = new();
public override int CurrentPageCount => Transactions.Count;
public string CryptoCode { get; set; }Why this scored 49/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.