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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Telerik HTML Editor in DNN 6.1.0Telerik HTML Editor in DNN 6.1.0
Previous
 
Next
New Post
11/8/2011 12:38 PM
 
Donald Johansson wrote:
I am trying to insert iFrames (google map and facebook like box) in the HTML module, and I am running into the same thing - it is being stripped out when I try to save.

Is this caused by the same issue? The code snippets contains no javascript at all. This used to work in 6.0 before I upgraded to 6.1.

 Yes, both <script and <iframe tags are removed. This breaks (for instance) embedded facebook like buttons, all sorts of stuff.

 
New Post
11/8/2011 1:44 PM
 
Oh wow, what a mess. I will need to alert all my customers not to do any updates to pages that contain Google maps or any other inserted widgets, or those will disappear with no easy way to get them back.

Cathal, any ETA on when the fix for this will be released? That's the first thing my customers will ask me, so it would be good to have some idea.

Thanks!
 
New Post
11/8/2011 1:54 PM
 
yes, both are stripped as an iframe can reference an external file such as a js (and do an XSS via it). I have no ETA, the changes have been made and the package has been submitted for testing so I don't believe it will be too long but it would not be wise for me to speculate on a release date.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
11/10/2011 7:00 AM
 
One behaviour I haven't seen discussed here that is happening to me is that if I use the HTML pane of either editor (RAD or Telerik), when I preview, all the HTML gets encoded which is DEFINITELY not what I want to happen.

I am in the process of converting content from a legacy HTML website to a DNN-based site. For most pages, I'm cutting and pasting the HTML from the legacy page into a new DNN page with a HTML/Text box. It seems to me I did convert several pages fine after the DNN 6.1 upgrade to the site, but perhaps I did them before the upgrade. I went to convert a page with complex HTML that was fairly important that I'd overlooked. I was shocked when using the usual methodology, the HTML looked find, the Design window in the editor was fine, but the moment I saved it or previewed it, all the HTML was encoded. Pasting formatted HTML copied from an HTML document to the Design window produced the same behaviour.

I experimented a bit. If I create content and mark it up in the Design window, it previews fine. If I flip over the the HTML window and make a change, preview now shows all the HTML encoded.

Clearly this is a major problem. Many content editors will format their material in another more competent editor and then paste it into the DNN editor. At the moment, this does not work correctly.

Could someone investigate why this is occuring? It seems related to the filtering issue for Javascript and IFrames. As other authors have indicated, the solution implemented is draconian solution. I have been working with DNN since version 2 and would like to know how serious this exploit really is. It seems to me with the granularity of security available in DNN would make the risk of someone unknown to the portal administrator having access to injecting malware via Javascript into any page in a site should be minimal. If it isn't, it points to a different security hole in DNN than HTML editing, either from the site administrator's side or DNN's code.

Regards,
Bob Reimer
Al Ain
United Arab Emirates
 
New Post
11/10/2011 6:49 PM
 
Kevin B. wrote:

While I agree that removing the script tags is more secure, we have too many users in our environment who have added script tags to their sites using the RadEditor provider for the HTML module. In our case, removing script tags has the potential to break hundreds of pages on dozens of sites. I found out about this change too long after upgrading to roll back, so I came up with a workaround for those who are interested. If you haven't already done so you'll need download the complete source version of DotNetNuke and install it on a dev machine. Because this workaround requires changing the source code and recompiling DotNetNuke.dll I won't recommend it as a permanent solution, but it works as a temporary solution.

The part of the DNN code that strips out the tags is found in the DotNetNuke.Library project, in the /UI/Usercontrols folder in a file called TextEditor.cs. You'll need to edit the "get" method for the public property "Text", as follows:

public string Text {
get {
PortalSecurity ps = new PortalSecurity();
string filterValue = string.Empty;

// DNN 6.1 Filters out > tags by default. We don't want this behavior
// so we'll just pass back the text from the editor without modifying it.
//filterValue = ps.InputFilter(TxtDesktopHTML.Text, PortalSecurity.FilterFlag.NoScripting);
filterValue = TxtDesktopHTML.Text;
switch (OptView.SelectedItem.Value) {
case "BASIC":
switch (OptRender.SelectedItem.Value) {
case "T": return Encode(HtmlUtils.ConvertToHtml(filterValue.ToString()));
//break;
case "R": return filterValue.ToString();
//break;
default: return Encode(filterValue.ToString());
//break;
}
default: return Encode(_richTextEditor.Text);
//return Encode(ps.InputFilter(_richTextEditor.Text, PortalSecurity.FilterFlag.NoScripting));
}
}
set {
if (!String.IsNullOrEmpty(value)) {
TxtDesktopHTML.Text = Decode(HtmlUtils.ConvertToText(value))
; _richTextEditor.Text = Decode(value);
}
}
}

Once you've made that change you need to recompile your solution, which should generate a brand-new DotNetNuke.dll reflecting your changes. The final step is to copy your new DotNetNuke.dll to the bin folder of your production server and you should be able to save script tags in your HTML module. Like I said, this is a temporary solution, as you'll need to make these changes to the code every time you upgrade. 

As far as future DNN releases are concerned, I think too many users are in the same situation as we are and have too many instances of the HTML module with script tags in them to dig through and move them to the page header or a third party module. As a compromise for future releases I'm in favor of removing the filtering of script tags from the DNN source code and instead relying on the RadEditor's native content filtering. I believe it's already been pointed out that the HTML Editor configuration page allows you to create different RadEditor Settings for different Security Groups. If DNN relied solely on the RadGrid's content filtering then people could just turn on the RadGrid's native content filtering for Registered Users and turn it off for Administrators. That way site administrators could have the flexibility they need without sacrificing security. Failing that, future releases of DotNetNuke could use a host or portal setting to determine whether to filter script tags or not. From what I've seen of the code it doesn't seem like it'd be that hard to change it to check against the host or portal settings before removing the script tags. 

In any event, I hope this code proves useful to someone, and I apologize for the length of the post. I'm definitely curious to see how this issue plays out in future releases.

 THANKS!!!   This helped tremendously!!!!

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Telerik HTML Editor in DNN 6.1.0Telerik HTML Editor in DNN 6.1.0


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