
SAriyandath356188 (Community Member) asked a question.
[Authorize]
[RoutePrefix("accounts")]
public class AccountsController : ApiController
{
private readonly IMembershipManager _membershipManager;
public AccountsController(IMembershipManager membershipManager)
{
_membershipManager = membershipManager;
}
}
public interface IMembershipManager
{
Task<ApplicationUserModel> Get(string username);
Task CreateUser(ApplicationUserModel user);
Task<bool> ChangePassword(ApplicationUserModel user, string newPassword);
}
public class ApplicationUserModel
{
[DataType(DataType.Text)]
public string User { get; set; }
[DataType(DataType.Text)]
public string Password { get; set; }
[DataType(DataType.Text)]
public string NewPass { get; set; }
}
In the above example, I'm getting Validation error for this line:
public AccountsController(IMembershipManager membershipManager)
Can someone help me to fix this?
.png)
CWE-100 can refer to a few types of input validation issues in models and controllers. Based off the code snippet provided, it is not clear which particular issue the scanner is referring to and is necessary to review the flaw details. To learn more about the identified flaw use the "Triage Flaws" view in the Veracode Platform from your application profile's static scan. From the "Triage Flaws" view, find the flaw and expand the "View Flaw Details" button. This will show the description as to why the scanner identified the flaw as well as the remediation to resolve the flaw. See screenshot example of the flaw details: https://help.veracode.com/r/review_static_flaw_viewer
For more information on navigating the "Triage Flaws" view, see "Reviewing Static Flaws" in our help center: https://help.veracode.com/reader/DGHxSJy3Gn3gtuSIN2jkRQ/Mc06F6Q5hbJof3KFFZMs6A
Please let us know if the remediation in "Triage Flaws" helps resolve your question.