File tree Expand file tree Collapse file tree
src/NuGetGallery/Controllers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- // Copyright (c) .NET Foundation. All rights reserved.
1+ // Copyright (c) .NET Foundation. All rights reserved.
22// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
44#pragma warning disable CA3147 // No need to validate Antiforgery Token with API request
@@ -426,8 +426,8 @@ public virtual Task<ActionResult> CreatePackagePut()
426426 [ ApiAuthorize ]
427427 [ ApiScopeRequired ( NuGetScopes . PackagePush , NuGetScopes . PackagePushVersion ) ]
428428 [ ActionName ( "PushPackageApi" ) ]
429- public virtual Task < ActionResult > CreatePackagePost ( )
430429 // CodeQL [SM00433] This endpoint uses API Key authentication
430+ public virtual Task < ActionResult > CreatePackagePost ( )
431431 {
432432 return CreatePackageInternal ( ) ;
433433 }
@@ -969,8 +969,8 @@ await PackageDeleteService.SoftDeletePackagesAsync(
969969 [ ApiAuthorize ]
970970 [ ApiScopeRequired ( NuGetScopes . PackageUnlist ) ]
971971 [ ActionName ( "PublishPackageApi" ) ]
972- public virtual async Task < ActionResult > PublishPackage ( string id , string version )
973972 // CodeQL [SM00433] This endpoint uses API Key authentication
973+ public virtual async Task < ActionResult > PublishPackage ( string id , string version )
974974 {
975975 var package = PackageService . FindPackageByIdAndVersionStrict ( id , version ) ;
976976 if ( package == null )
Original file line number Diff line number Diff line change 1- // Copyright (c) .NET Foundation. All rights reserved.
1+ // Copyright (c) .NET Foundation. All rights reserved.
22// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
44using System ;
@@ -479,6 +479,7 @@ public virtual ActionResult AuthenticateExternal(string returnUrl)
479479 userOrganizationsWithTenantPolicy . Select ( member => member . Organization . Username ) ) ;
480480
481481 TempData [ "WarningMessage" ] = string . Format ( Strings . ChangeCredential_NotAllowed , orgList ) ;
482+ // CodeQL [SM00405] the return URL is validated to be a relative URL before redirecting using Url.IsLocalUrl.
482483 return Redirect ( returnUrl ) ;
483484 }
484485 }
@@ -487,6 +488,7 @@ public virtual ActionResult AuthenticateExternal(string returnUrl)
487488 if ( externalAuthProvider == null )
488489 {
489490 TempData [ "Message" ] = Strings . ChangeCredential_ProviderNotFound ;
491+ // CodeQL [SM00405] the return URL is validated to be a relative URL before redirecting using Url.IsLocalUrl.
490492 return Redirect ( returnUrl ) ;
491493 }
492494
You can’t perform that action at this time.
0 commit comments