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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsFCKeditorFCKeditorIs there ANY way to prevent HTML code injection attack?Is there ANY way to prevent HTML code injection attack?
Previous
 
Next
New Post
1/31/2007 4:12 AM
 

I understand that by allowing an HTML editor, there is always the risk for javascript/iframe etc injection. However is there anyway to at least reduce it? I mean is it possible to disable the < > tags while the "Source" mode is not used? That way I can just take out the "Source" toolbar for normal users and preseve it for admins only. Right now it seems even when "Source" is not pressed, any HTML tags entered in the text window still works.

 
New Post
2/1/2007 9:45 PM
 

Take a look at the fckconfig.js file and the FCKConfig.ProtectedSource

i.e:

FCKConfig.ProtectedSource.Add("Your Regex")

then all matching text will be html encoded by default. If you apply this to the iframe tags, then no injection will work. Now all depends on your imagination and your regex knowledge (Follow the few samples in that file)


Locopon
Free modules: E-commerce, Complete localization (Portal, page, module settings, skins, etc.), Secure Login, and more
http://dnn.tiendaboliviana.com
 
New Post
2/1/2007 10:19 PM
 

I checked my FCKConfig.js and the following lines are already there:

FCKConfig.ProtectedSource.Add( /<script[\s\S]*?\/script>/gi ) ; // <SCRIPT> tags.
FCKConfig.ProtectedSource.Add( /<%[\s\S]*?%>/g ) ; // ASP style server side code <%...%>
FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ; // PHP style server side code <?...?>
FCKConfig.ProtectedSource.Add( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi ) ; // ASP.Net style tags <asp:control>
FCKConfig.ProtectedSource.Add( /<iframe>[\s\S]*?<\/iframe>/g ) ;
FCKConfig.ProtectedSource.Add( /<html>[\s\S]*?<\/html>/g ) ;
FCKConfig.ProtectedSource.Add( /<script[^\>]+>[\s\S]*?<\/script>/g ) ;
FCKConfig.ProtectedSource.Add( /<code>[\s\S]*?<\/code>/g ) ;

Are these supposed rules to filter out the tags? But script tags and iframe tags still work in my editor. Is there some option that I need to turn on to enforce these rules?

 
New Post
2/1/2007 11:28 PM
 

please remember to always clear your browser and DNN cache to allow the .js file to be reloaded

 


Locopon
Free modules: E-commerce, Complete localization (Portal, page, module settings, skins, etc.), Secure Login, and more
http://dnn.tiendaboliviana.com
 
New Post
2/1/2007 11:36 PM
 
No the lines had always been there, untouched. But are those rules actually set to prevent the script and iframe tags from being rendered by the browser (which is what I want to do)? Basically I do not want an end user using FCKeditor to be able to use "script" and "iframe" tags. I want to prevent someone from loading malicious scripts/websites that can harm other people's computers.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsFCKeditorFCKeditorIs there ANY way to prevent HTML code injection attack?Is there ANY way to prevent HTML code injection attack?


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