security - Disabling javascript in specific block/div (containing suspect HTML)? -


Is it possible to disable the browser execution of the script inside block / section / element?

My scenario is, I make my (future) users "using rich content" (using CK-Editor). Content that can be shown to other users later - with all the threats that show: XSS, redirection, identity theft, spam and what not ...

I tried,

What I'm really looking for is something like this:

& lt; Div id = "userContent"> & lt; ScriptOFF>

HTML Suspicious

& lt; / ScriptOFF> & lt; / Div>

Ideally, do not accept html / javascript from end users. If you are okay with that limit, then you need to make sure that you have the right reference accordingly. Do not re-invent the wheel, just use the existing library for that purpose.

But if you have to accept HTML, then use the library or as it was actually created for this purpose.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -