Skip to content

Disable XML entity size limits when parsing watchface XML - #116

Merged
lucianbc merged 6 commits into
mainfrom
lucianbc/disable-xml-entity-size-limits
Oct 16, 2026
Merged

lucianbc merged 6 commits into
mainfrom
lucianbc/disable-xml-entity-size-limits

Conversation

@lucianbc

@lucianbc lucianbc commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Newer JDK versions have a stricter limit on XML entity count, but watch face layouts can legitimately go past this limit.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request configures the XML TransformerFactory to disable entity size limits (setting them to 0) to allow parsing watch faces with a large number of entity references, and adds a test verifying this behavior. However, disabling these limits introduces security risks, specifically making the parser vulnerable to XML Entity Expansion (Billion Laughs) and XXE attacks. It is recommended to disable DTDs entirely to mitigate these vulnerabilities while still allowing pre-defined entities.

@lucianbc lucianbc self-assigned this Oct 15, 2026
@lucianbc
lucianbc merged commit d1cdafa into main Oct 16, 2026
10 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