You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * @name Insecure Direct Object Reference * @description Using user input to control which object is modified without * proper authorization checks allows an attacker to modify arbitrary objects. * @kind problem * @problem.severity error * @security-severity 7.5 * @precision medium * @id cs/web/insecure-direct-object-reference * @tags security * external/cwe-639 */import csharp
import semmle.code.csharp.security.auth.InsecureDirectObjectReferenceQuery
fromActionMethodmwherehasInsecureDirectObjectReference(m)selectm,"This method may be missing authorization checks for which users can access the resource of the provided ID."
[HttpGet("{storeId}/delete")]
public IActionResult DeleteStore(string storeId)
{
return View("Confirm", new ConfirmModel("Delete store", "The store will be permanently deleted. This action will also delete all invoices, apps and data associated with the store. Are you sure?", "Delete"));
This method may be missing authorization checks for which users can access the resource of the provided ID.
[HttpGet("{storeId}/onchain/{cryptoCode}/delete")]
public ActionResult DeleteWallet(string storeId, string cryptoCode)
{
var checkResult = IsAvailable(cryptoCode, out var store, out var network);
This method may be missing authorization checks for which users can access the resource of the provided ID.
[HttpPost("{storeId}/onchain/{cryptoCode}/delete")]
public async Task<IActionResult> ConfirmDeleteWallet(string storeId, string cryptoCode)
{
var checkResult = IsAvailable(cryptoCode, out var store, out var network);
This method may be missing authorization checks for which users can access the resource of the provided ID.
[HttpPost]
[Route("{walletId}")]
public async Task<IActionResult> ModifyTransaction(
// We need addlabel and addlabelclick. addlabel is the + button if the label does not exists,
// addlabelclick is if the user click on existing label. For some reason, reusing the same name attribute for both
This method may be missing authorization checks for which users can access the resource of the provided ID.
[HttpGet("~/stores/{storeId}/forms/modify/{id}")]
public async Task<IActionResult> Modify(string storeId, string id)
{
var form = await _formDataService.GetForm(storeId, id);
This method may be missing authorization checks for which users can access the resource of the provided ID.
[HttpPost("~/stores/{storeId}/forms/modify/{id?}")]
public async Task<IActionResult> Modify(string storeId, string? id, ModifyForm modifyForm)
{
if (id is not null)
This method may be missing authorization checks for which users can access the resource of the provided ID.
[HttpDelete]
[Authorize(Policy = Permission.AliasesDelete)]
public async Task<IActionResult> Delete([FromBody]Guid id)
{
var alias = await _service.Delete(id);
This method may be missing authorization checks for which users can access the resource of the provided ID.
[HttpPost]
[ValidateAntiForgeryToken]
public virtual async Task<IActionResult> CountryDelete(Guid countryId, int returnPageNumber = 1)
{
var country = await DataManager.FetchCountry(countryId);
This method may be missing authorization checks for which users can access the resource of the provided ID.
[HttpDelete("{orderId}/{productId}")]
public async Task<ActionResult> Delete(int orderId, int productId)
{
var repository = new OrderDetailsRepository(_context);
This method may be missing authorization checks for which users can access the resource of the provided ID.
}
public async Task<ActionResult> Delete([FromODataUri] int keyOrderID, [FromODataUri] int keyProductID)
{
var repository = new OrderDetailsRepository(_context);
This method may be missing authorization checks for which users can access the resource of the provided ID.
[HttpDelete("odata/Orders({keyOrderID})/OrderDetails(orderID={orderID},productID={productID})")]
public async Task<ActionResult> DeleteToOrderDetails([FromODataUri] int orderID, [FromODataUri] int productID)
{
var repository = new OrderDetailsRepository(_context);
This method may be missing authorization checks for which users can access the resource of the provided ID.
[ApiPermissionOrAnonymous(PermissionIds.AppAssetFoldersDelete)]
[ApiCosts(1)]
public async Task<IActionResult> DeleteAssetFolder(string app, DomainId id)
{
var command = new DeleteAssetFolder { AssetFolderId = id };
This method may be missing authorization checks for which users can access the resource of the provided ID.
[ApiPermissionOrAnonymous(PermissionIds.AppRulesDelete)]
[ApiCosts(1)]
public async Task<IActionResult> DeleteRule(string app, DomainId id)
{
var command = new DeleteRule { RuleId = id };
This method may be missing authorization checks for which users can access the resource of the provided ID.
[ProducesResponseType(StatusCodes.Status200OK)]
// TODO: This needs to be an authorized endpoint.
public async Task<IActionResult> Delete(int id)
{
ILanguage? language = _localizationService.GetLanguageById(id);
This method may be missing authorization checks for which users can access the resource of the provided ID.
[CustomAuthorize("Customers", "Write")]
[HttpGet("customer-management/edit-customer/{id:guid}")]
public async Task<IActionResult> Edit(Guid? id)
{
if (id == null) return NotFound();
This method may be missing authorization checks for which users can access the resource of the provided ID.
[CustomAuthorize("Customers", "Remove")]
[HttpGet("customer-management/remove-customer/{id:guid}")]
public async Task<IActionResult> Delete(Guid? id)
{
if (id == null) return NotFound();
This method may be missing authorization checks for which users can access the resource of the provided ID.
[ProducesResponseType((int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public async Task<IActionResult> Delete(Guid id)
{
var group = await _groupRepository.GetByIdAsync(id);
This method may be missing authorization checks for which users can access the resource of the provided ID.
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesDefaultResponseType]
public async Task<ActionResult> DeleteOrder(int id)
{
var command = new DeleteOrderCommand() { Id = id };
This method may be missing authorization checks for which users can access the resource of the provided ID.
[HttpDelete]
[Route("admin/host/extensions/{id}")]
public async Task<IActionResult> Delete(string id)
{
if (_extensionBundleManager.IsExtensionBundleConfigured())
This method may be missing authorization checks for which users can access the resource of the provided ID.
[HttpDelete("/conversation/{agentId}/{conversationId}")]
public async Task DeleteConversation([FromRoute] string agentId, [FromRoute] string conversationId)
{
var service = _services.GetRequiredService<IConversationService>();
This method may be missing authorization checks for which users can access the resource of the provided ID.