Skip to content

xml BUGFIX reject character references that overflow - #2623

Merged
michalvasko merged 1 commit into
CESNET:develfrom
affan-arch:xml-charref-overflow
Nov 9, 2026
Merged

michalvasko merged 1 commit into
CESNET:develfrom
affan-arch:xml-charref-overflow

Conversation

@affan-arch

Copy link
Copy Markdown

lyxml_parse_value() accumulated the code point of &#...; and &#x...; references in a uint32_t with no bound, so &#4294967356; or &#x10000003C; wrapped around and decoded to < (any other character can be produced the same way) where libxml2 and expat reject them as out of range; it now fails with the existing invalid character reference error once the value is past 0x10ffff and more digits follow, so leading zeros keep working.

The code point of a character reference was accumulated in a uint32_t
without a bound, so a reference with enough digits wrapped around
before ly_pututf8() checked its range. &#4294967356; and &#x10000003C;
were both decoded to '<' instead of being rejected as out of range.
@michalvasko
michalvasko changed the base branch from master to devel November 9, 2026 14:22
@michalvasko

Copy link
Copy Markdown
Member

Thanks, looks fine, but I have changed the target branch to devel, it will get to master on the next release.

@michalvasko
michalvasko merged commit 036b1f5 into CESNET:devel Nov 9, 2026
11 of 13 checks passed
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.

2 participants