TinyMCE - "A potentially dangerous Request.Form value was detected from the client"

rated by 0 users
This post has 4 Replies | 2 Followers

Not Ranked
Posts 15
Points 225
P4 Healthcare Posted: Fri, Apr 25 2008 1:57 PM

Hi,
I am running CS 2008 Professional Edition on Windows Vista/IIS7 and when I try to post anything with the TinyMCE rich text box, I get this exception:

A potentially dangerous Request.Form value was detected from the client (ctl00$bcr$ctl01$ctl02$Message$ctl00$Editor="<p>test</p>").

It doesn't like the html in the posted content.  TinyMCE's site suggests setting ValidateRequest=false, but I don't want to remove that security.

Any suggestions?

Top 10 Contributor
Posts 3,424
Points 65,735
CS Developers
Ben Tiedt replied on Fri, Apr 25 2008 2:06 PM

validateRequest="false" is part of the CS2008 default web.config file and should not be removed.

I'd suggest restoring this configuration.

Ben Tiedt's Blog

  • | Post Points: 20
Not Ranked
Posts 15
Points 225

I assume that CS2008 is then doing its own filtering to prevent malicious posting.  I see the <MarkUp> section of CommunityServer.config... is this being used to globally filter any user input in place of validateRequest?

My concern is that I am integrating CS2008 with my own application and I do not want to leave my own forms open to attack.

Is there a way that I can process my own forms with the same rules that CS is using?

  • | Post Points: 20
Top 10 Contributor
Posts 3,424
Points 65,735
CS Developers
Ben Tiedt replied on Fri, Apr 25 2008 3:12 PM

P4 Healthcare:
is this being used to globally filter any user input in place of validateRequest?
 

Where HTML content is allowed, it is filtered through the HTML scrubber in Community Server (by default).  Where HTML content is not allowed, values are encoded for rendering in HTML.

You could either:

1.  If your custom app lives side-by-side with Community Server, you could only disable request validation in Community Server

2.  If your custom app lives within Community Server, you can use the CommunityServer.Components.HtmlScrubber to remove potentially harmful HTML from inputs and/or HTML encode incoming data.

Ben Tiedt's Blog

  • | Post Points: 20
Not Ranked
Posts 15
Points 225

Community Server lives in a subdirectory of my Web App.

Problem solved: I dropped a small Web.config into my CommunityServer directory with <pages validateRequest="false" />.

 

Thanks,
Graham

  • | Post Points: 5
Page 1 of 1 (5 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com