简体   繁体   中英

Are intranet sites vulnerable to CSRF?

I have developed and deployed an MVC5 .NET app which runs within an intranet and uses LDAP to authenticate users. Since MVC 5 gives you the @Html.Antiforgery() by default I used them in every from. However in production where the app is running in multiple nodes I'm having problems with the tokens when sessions expire etc.

So i was wondering if I should even be using them in the first place or if I could just remove them since the site runs on an intranet.

Yes, they are. For example, a malicious user could send one of your employees and email containing a clear GIF with a URL that points at one of your intranet pages, or an employee could visit a web page that contains javascript that posts to one of your intranet pages.

The mitigation for the clear GIF attack is to design your intranet site so that GET requests never update state or perform sensitive operations.

The mitigation for the script/post attack is to include a CSRF token in all of your forms.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM