Skip to content

Reject NUL and surrogate code points in GetCharacterRef - #1104

Open
darshan-mog wants to merge 1 commit into
leethomason:masterfrom
darshan-mog:charref-nul-surrogate
Open

darshan-mog wants to merge 1 commit into
leethomason:masterfrom
darshan-mog:charref-nul-surrogate

Conversation

@darshan-mog

Copy link
Copy Markdown

XMLUtil::GetCharacterRef only checks the decoded value against 0x10FFFF, so &#0; and the digit-less &#; / &#x; (which accumulate to 0) decode to a NUL byte that GetStr writes into the value, and <t v='admin&#0;.evil.com'/> reads back as admin with no error while conforming parsers reject the document. Surrogate references (&#xD800; to &#xDFFF;) are likewise encoded as invalid UTF-8 (ED A0 80). Reject these code points the same way out-of-range references already are, so the reference is left as literal text; a regression test is added next to the existing char ref tests.

This branch has not been deployed

No deployments
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