Skip to content

bleach.clean() on junk/malicious content produces gibberish #193

@byashimov

Description

@byashimov

I had a XSS on my website:

a = u"""""><iframe/onload=alert(/XSS/)
ejgirjrigjifjifhrhgijsvishguhisuhhshuxnuesneuschhhhhhhhhhhs 
""><iframe/onload=alert(/XSS/)Секреты покраски
Для наилучшего результата вам потребуется нанести несколько слоев, <div></div>"""

print bleach.clean(a)
""&gt;&lt;iframe onload="alert(/XSS/)" ejgirjrigjifjifhrhgijsvishguhisuhhshuxnuesneuschhhhhhhhhhhs="" ""=""&gt;&lt;iframe onload="alert(/XSS/)Секреты" покраски="" Для="" наилучшего="" результата="" вам="" потребуется="" нанести="" несколько="" слоев,="" &lt;div=""&gt;&lt;/div&gt;

Every word becomes an html attribute.
Latest bleach from pypi is used.
UPD: updated the string, missed extra quote.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions