Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Module development and CSRF protectionModule development and CSRF protection
Previous
 
Next
New Post
1/20/2015 1:56 PM
 

I understand that DNN provides built-in protection against CSRF attacks through ViewState (with userkey).

However, I wonder if that security is automatically integrated on every page, or should I integrate my own CSRF protection when I develop a custom module?

I tried checking the security guide, but that link seems broken (link is listed here).

 
New Post
1/21/2015 3:03 PM
 
viewstateuserkey is implemented on each page so no need to apply that yourself - if you are using service framework methods you need to ensure that they use the ValidateAntiForgeryToken and HttpPost attributes.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
1/22/2015 2:34 AM
 
My set-up is the following:

I created a module, which calls a Web API service serverside. The user interacts only with the module, the module's code behind calls a Web API. This Web API has nothing to do with DNN, it is a separate API.

So the only attack vector is the module's front-end, which is by default adequately secured against CSRF, right? I understand that, if I would call a service directly, I would need to implement an anti-CSRF token myself, but as the call to my Web API leaves from server-side, there's no need to implement it myself?
 
New Post
1/22/2015 12:08 PM
 
yup -if it's server to server no-one can alter the data. However the normal way is client (ajax request) to server, in which case the server component (service framework) needs the ValidateAntiForgeryToken attribute

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
9/4/2015 10:14 AM
 

With another account, but I'm the TS.

I have looked into this issue again, and there does seem to be something vulnerable. 

Set-up: we have implemented a module, and inserted it on the website. This module does some processing in the back-end, but that is not relevant.

Scenario:

- I open this page in a browser, and intercept the submission with Fiddler
- I open the same page in a browser as another user, and note my session id on a piece of paper
- IOn the PC with Fiddler open, I replay and intercept the first request. I change the session id with the one I wrote on a piece of paper, and submit.

=> The request is approved and effectively executed.

 

This seems like CSRF to me. So I need some custom protection for all of my modules to protect against that? 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Module development and CSRF protectionModule development and CSRF protection


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out