Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am using CKEditor/CKFinder as wysiwyg editor on my MVC.NET site.

I have set [ValidateInput(false)] and it works when debugging it locally, but I receive the following error when I have published the site:

A potentially dangerous Request.Form value was detected from the client (message="<p>
<em>Testing</e...").

can anyone explain why the published site is different from the locally site, especially when I have set [ValidateInput(false)]?

*Update:*I am using .Net 3.5 so shouldn't [ValidateInput(false)] work out the box?

like image 906
Dofs Avatar asked Jan 07 '11 22:01

Dofs


2 Answers

Have you tried setting the htmlEncodeOutput property?

CKEDITOR.replace('editor1', {
    htmlEncodeOutput: true });

This should encode the output and you should be able to avoid setting the requestValidationMode.

Documentation for it is here: ckEditor documentation

like image 126
Catch22 Avatar answered Sep 29 '22 22:09

Catch22


Add this to your web.config:

<httpRuntime requestValidationMode="2.0" />
like image 24
stian.net Avatar answered Sep 29 '22 22:09

stian.net