How to prevent any possible CSRF attack on my Public WCF soap Service ?
i know that the main solution is by using a CSRF Token , but how i can achieve that ?
hopefully some one give me idea , or at least to tell me that WCF cannot be CSRF attacked.
How to prevent any possible CSRF attack on my Public WCF soap Service ?
i know that the main solution is by using a CSRF Token , but how i can achieve that ?
hopefully some one give me idea , or at least to tell me that WCF cannot be CSRF attacked.
Yes, CSRF applies to WCF if you have enabled AJAX support for your service.
A quick and easy way to mitigate is to set a check a custom header such as the X-Requested-With request header. These headers cannot be passed cross-domain without CORS being enabled.
To further strengthen this solution, you could also set a token per session and then pass this in the header also. See this answer. This would mitigate vulnerabilities in browser plugins such as Flash and Silverlight where the former had previously suffered from a bug which allowed arbitrary headers to be set cross-domain that shouldn't be allowed otherwise.