How to mitigate CWE-316: Cleartext Storage of Sensitive Information in Memory in MVC Model

1.2k Views Asked by At

I have MVC model where I declare a property Password with DataType annotation as DataType.Password.

Veracode scan points out the line with that property declaration.

That property is getting its value assigned from a login page.

I saw examples of using SecureString. But how can I change the declaration of my property in the model and map it to the login page?

This is the property declaration:

[DataType(DataType.Password)]
public string Password {get;set;} 

Then in the code, I use that property to log in to the application.

HOw can I change the declaration, so I fix the Veracode error?

0

There are 0 best solutions below