Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
escape_xml in the RSS feed escaped the five XML specials but not the control characters that XML 1.0 simply forbids (\x00-\x08, \x0b, \x0c, \x0e-\x1f). Escaping doesn't make those legal. bleach.clean on upload doesn't strip them either, so a crackme name or description containing a vertical tab went into the feed verbatim and every XML parser rejected the whole feed until the item scrolled out of the 50-item window. One upload could break /rss for everyone.
Fix: escape_xml now drops those characters before escaping. Tab, newline and carriage return are kept since XML allows them.
Added a test that puts \x0b, \x0c and \x08 into a crackme name and info and asserts the feed still parses and none of the bytes survive. Fails without the fix, passes with it. All tests in test_rss_and_errors.py pass, 6 total.