Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip malformed nested tags #11

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ashokak
Copy link

@ashokak ashokak commented May 26, 2015

The main aim here is to avoid constructions like this from resulting in a script tag in the resulting output:

This is <a href="#html">HTML</a> with a <scr<script></script>ipt src="evil.js">SCRIPT

The other changes are:

  • to add tests for the blacklist mode of sanitize
  • to clear style and script blocks, including their bodies, even when the closing tag has any content (including just whitespace)

Please let me know if you'd rather have any of these parts as individual pull requests.

ashokak added 6 commits May 26, 2015 05:16
This disallows mis-nesting script tags to produce out that still has a script tag in.
In practice, this isn't so bad, as the script (or style) tags are still eliminated. It's odd that the body is still left in the resulting document, though.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant