This is a migrated thread and some comments may be shown as answers.

[Solved] avoid xss

1 Answer 154 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Kashif Imran
Top achievements
Rank 1
Kashif Imran asked on 15 May 2009, 12:41 AM
Does RadEditor has any builtin option to help avoiding xss etc.

I tried two code blocks below. one with javascript and other with iframe.

<script type="text/javascript">
alert("HI");
</script>

<iframe src=http://www.google.com height="200" width="200"/>

javascript did not get executed but I got iframe in the page. Normally I would do HtmlEncode and HtmlDecore. But If I need to keep tags like bold , italic etc, how can I do that?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 18 May 2009, 12:03 PM
Hi Kashif,

The safest way is to modify the iframe tag on the server. The content outputted via the editor's server property is a string and you can modify it using the RadEditor1.Content.Replace() method.

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Kashif Imran
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or