Notes
![]() ![]() Notes - notes.io |
This page has four areas: Information about the challenge with a radiogroup of options to select as answer, a tree view “File Explorer” containing the project files, a “Code blocks” section with a list of code blocks relevant to the challenge, and a code viewer section. The code viewer section has tabs displaying opened files, with the currently opened file presented in a table. This table has three columns: Code block indicator (only present on the first line of a code block), line number, and the code itself. Each line of code within a code block is prefixed with ‘CBX’, where X is a number used to distinguish between code blocks. Opening category information, hints or submit buttons will open a modal dialog.
Skip to Code Editor
Identify the vulnerability
Fix the vulnerability
Identify the vulnerability
Identify the type of vulnerability present in the code. Code blocks that are vulnerable are marked with warning icons (). Additional code blocks that may give context may be marked with lightbulb icons ().
Select Vulnerability Category
Access Control
Missing Function Level Access Control
Denial of Service
Regular Expression DoS
Memory Corruption
Race Conditions
Server-Side Request Forgery
Server-Side Request Forgery (SSRF)
Actions
Attempts left: 1
View shortcuts keyboard hotkey:?
File Explorer
Highlighted files only: 85 files hidden
Controllers1 code blocks
AccountController.cs1 code blocks
1
Code blocks
AccountController.cs:38-40
using ArticlesAggregator.Models;
using ProductsCatalog.Models.Account;
using ProductsCatalog.Services;
using ProductsCatalog.Services.Authorization;
using System.Threading.Tasks;
using System.Web.Http;
namespace ProductsCatalog.Controllers
{
public class AccountController : CustomApiController
{
private readonly UserManager userManager = new UserManager();
private readonly RoleManager roleManager = new RoleManager();
[HttpPost]
public Task<IHttpActionResult> ChangePassword(ChangePasswordModel model) =>
Ok(this.userManager.TryChangePassword(model));
[HttpDelete, Authorize]
public Task<IHttpActionResult> Delete() =>
Ok(this.userManager.Delete(UserManager.UserId));
[HttpPost]
public Task<IHttpActionResult> DeleteById(DeleteUserModel model) =>
Ok(this.userManager.Delete(model.UserId));
[HttpPost, AllowAnonymous]
public async Task<IHttpActionResult> Register(RegisterModel model)
{
if (await this.userManager.UserNameExists(model.UserName) ||
await this.userManager.UserEmailExists(model.Email))
return BadRequest("User is already registered");
var userId = await this.userManager.Create(model);
return Ok(userId);
}
[HttpPost]
public Task<IHttpActionResult> AddToRole(AddToRoleModel model) =>
Ok(this.roleManager.AddRole(model.UserId, model.Role));
[HttpPost]
public Task<IHttpActionResult> RemoveFromRole(RemoveFromRoleModel model) =>
Ok(this.roleManager.RemoveRole(model.UserId, model.Role));
[HttpPost, Authorize]
public async Task<IHttpActionResult> ResetPassword(ResetPasswordModel model) =>
await this.userManager.ResetPassword(model)
? Ok("Your password has been changed successfully") as IHttpActionResult
: BadRequest("An error occurred while the password reset. " +
"Please contact the administrator.");
[HttpPost, AllowAnonymous]
public async Task<IHttpActionResult> RestorePassword(RestorePasswordModel model) =>
await this.userManager.RestorePassword(model);
return Ok(new ControllerResultMessage(
"If the email you provided is registered, you should receive a message with a reset token. " +
"Use this token to reset your password by calling the ResetPassword action."));
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team