Skip to content

Fix XXE vulnerability in JunitReportReader#49

Open
micheleh wants to merge 1 commit intomasterfrom
fix/xxe-vulnerability-junit-reader
Open

Fix XXE vulnerability in JunitReportReader#49
micheleh wants to merge 1 commit intomasterfrom
fix/xxe-vulnerability-junit-reader

Conversation

@micheleh
Copy link
Copy Markdown
Collaborator

@micheleh micheleh commented Apr 3, 2026

Summary

  • Disabled external entity resolution and DTD processing in JunitReportReader's XML parser
  • Prevents two attack vectors: arbitrary file read via external entities, and denial of service via entity expansion (billion laughs)

Context

The XMLInputFactory was created with default settings since the initial commit (c71ed1f, 2021-11-15). Java's defaults enable DTD processing and external entity resolution, which is a known XXE vulnerability (OWASP Top 10).

The fix adds two properties before creating the reader:

xmlInputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
xmlInputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false);

Verification

  • Both attack vectors confirmed exploitable before the fix, blocked after
  • Full test suite passes (44 tests, 0 failures)

Disable external entity resolution and DTD processing on the
XMLInputFactory used to parse JUnit XML reports. Without this,
a crafted report file could read arbitrary local files or cause
denial of service via entity expansion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@micheleh micheleh requested a review from nissimshitrit April 3, 2026 11:57
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