What changed, and why it matters
This commit removes nullable markers ('?') from some string parameters and adds explicit controller names to two URL helper methods. It is titled 'fix warnings' and appears to be a routine compiler-warning cleanup. There is no direct evidence in the commit that these changes fix a security vulnerability.
No immediate security action required. Treat as routine maintenance. If concerned, verify that the nullable annotation changes do not alter runtime behavior in the target framework version.
Security signals we found
No authorization changes
No input validation changes
No cryptographic changes
No data exposure changes
No unsafe function usage introduced
Evidence from the diff
In GreenfieldPaymentRequestsController.cs, nullable reference type annotations are removed from string route parameters (storeId, paymentRequestId). In UrlHelperExtensions.cs, the controller name ‘UIWallets’ is added to helper.Action() calls for WalletSend and WalletTransactions. These are typical warning-fix/refactoring changes. The diff does not show any authorization, validation, or data-handling changes that would indicate a security fix.
Changed components
BTCPayServer/Controllers/GreenField/GreenfieldPaymentRequestsController.csBTCPayServer/Extensions/UrlHelperExtensions.csInspect captured patch +7 / −7
diff --git a/BTCPayServer/Controllers/GreenField/GreenfieldPaymentRequestsController.cs b/BTCPayServer/Controllers/GreenField/GreenfieldPaymentRequestsController.cs
index 7ca8ba0..006f3cd 100644
--- a/BTCPayServer/Controllers/GreenField/GreenfieldPaymentRequestsController.cs
+++ b/BTCPayServer/Controllers/GreenField/GreenfieldPaymentRequestsController.cs
@@ -59,7 +59,7 @@ namespace BTCPayServer.Controllers.Greenfield
[Authorize(Policy = Policies.CanViewPaymentRequests, AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[HttpGet("~/api/v1/stores/{storeId}/payment-requests/{paymentRequestId}")]
[HttpGet("~/api/v1/payment-requests/{paymentRequestId}")]
- public async Task<IActionResult> GetPaymentRequest(string? storeId, string paymentRequestId)
+ public async Task<IActionResult> GetPaymentRequest(string storeId, string paymentRequestId)
{
var pr = HttpContext.GetPaymentRequestDataOrNull();
@@ -72,7 +72,7 @@ namespace BTCPayServer.Controllers.Greenfield
[Authorize(Policy = Policies.CanViewPaymentRequests, AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[HttpPost("~/api/v1/stores/{storeId}/payment-requests/{paymentRequestId}/pay")]
[HttpPost("~/api/v1/payment-requests/{paymentRequestId}/pay")]
- public async Task<IActionResult> PayPaymentRequest(string? storeId, string paymentRequestId, [FromBody] PayPaymentRequestRequest pay, CancellationToken cancellationToken)
+ public async Task<IActionResult> PayPaymentRequest(string storeId, string paymentRequestId, [FromBody] PayPaymentRequestRequest pay, CancellationToken cancellationToken)
{
var p = HttpContext.GetPaymentRequestDataOrNull();
if (p is null)
@@ -132,7 +132,7 @@ namespace BTCPayServer.Controllers.Greenfield
AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[HttpDelete("~/api/v1/stores/{storeId}/payment-requests/{paymentRequestId}")]
[HttpDelete("~/api/v1/payment-requests/{paymentRequestId}")]
- public async Task<IActionResult> ArchivePaymentRequest(string? storeId, string paymentRequestId)
+ public async Task<IActionResult> ArchivePaymentRequest(string storeId, string paymentRequestId)
{
var pr = HttpContext.GetPaymentRequestDataOrNull();
if (pr is null || pr.Archived)
@@ -148,9 +148,9 @@ namespace BTCPayServer.Controllers.Greenfield
[Authorize(Policy = Policies.CanModifyPaymentRequests,
AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
public async Task<IActionResult> CreateOrUpdatePaymentRequest(
- [FromRoute] string? storeId,
+ [FromRoute] string storeId,
PaymentRequestBaseData request,
- [FromRoute] string? paymentRequestId = null)
+ [FromRoute] string paymentRequestId = null)
{
if (request is null)
return BadRequest();
diff --git a/BTCPayServer/Extensions/UrlHelperExtensions.cs b/BTCPayServer/Extensions/UrlHelperExtensions.cs
index d220af5..b9b86a8 100644
--- a/BTCPayServer/Extensions/UrlHelperExtensions.cs
+++ b/BTCPayServer/Extensions/UrlHelperExtensions.cs
@@ -13,10 +13,10 @@ namespace Microsoft.AspNetCore.Mvc
public static class UrlHelperExtensions
{
#nullable enable
- public static string? WalletSend(this IUrlHelper helper, WalletId walletId) => helper.Action(nameof(UIWalletsController.WalletSend), new { area = WalletsPlugin.Area, walletId });
+ public static string? WalletSend(this IUrlHelper helper, WalletId walletId) => helper.Action(nameof(UIWalletsController.WalletSend), "UIWallets", new { area = WalletsPlugin.Area, walletId });
public static string? WalletTransactions(this IUrlHelper helper, string walletId) => WalletTransactions(helper, WalletId.Parse(walletId));
public static string? WalletTransactions(this IUrlHelper helper, WalletId walletId)
- => helper.Action(nameof(UIWalletsController.WalletTransactions), new { area = WalletsPlugin.Area, walletId });
+ => helper.Action(nameof(UIWalletsController.WalletTransactions), "UIWallets", new { area = WalletsPlugin.Area, walletId });
public static Uri ActionAbsolute(this IUrlHelper helper, HttpRequest request, string? action, string? controller, object? values)
=> request.GetAbsoluteUriNoPathBase(new Uri(helper.Action(action, controller, values) ?? "", UriKind.Relative));
public static Uri ActionAbsolute(this IUrlHelper helper, HttpRequest request, string? action, string? controller)
Why this scored 11/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.