TSaha029552 (Community Member) asked a question.

CSRF (CWE - 352) flaw in Web Api Controllers

We have an Web API project and have [HttpPost] controller methods. They are being flagged with CSRF (CWE 352).

So, we implemented the fix, which is decorating our controller classes with [ApiController] attribute. But, still Veracode scan is flagging the same.

Interestingly, it resolved - CWE 915 (Improperly Controlled Modification of Dynamically-Determined Object) but not able to resolve CWE 352.

We are using .NET Core 3.1 version in our Web Api project. Any advice on how to fix this vulnerability.

Adding further, this API is not directly exposed to the customer facing area and there are couple of enterprise layers/ API gateways before the API endpoints could be reached.


Topics (2)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.