Skip to content

Strip XML-forbidden control characters from RSS feed - #192

Open
B58TU wants to merge 1 commit into
crackmesone:mainfrom
B58TU:fix/rss-invalid-xml-chars
Open

B58TU wants to merge 1 commit into
crackmesone:mainfrom
B58TU:fix/rss-invalid-xml-chars

Conversation

@B58TU

@B58TU B58TU commented Sep 23, 2026

Copy link
Copy Markdown

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.

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