Skip to content

Harden ECore XML parsing against XXE (#29)#67

Merged
samatstariongroup merged 1 commit into
developmentfrom
GH29
May 31, 2026
Merged

Harden ECore XML parsing against XXE (#29)#67
samatstariongroup merged 1 commit into
developmentfrom
GH29

Conversation

@samatstariongroup
Copy link
Copy Markdown
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the EcoreNetto code style guidelines
  • I have provided test coverage for my change (where applicable)

Description

Hardens ECoreParser.ParseXml against XML External Entity (XXE) attacks and entity-expansion DoS by setting DtdProcessing = Prohibit and XmlResolver = null on the XmlReaderSettings, and XmlResolver = null on the XmlDocument. Valid .ecore files (which contain no DTD) are unaffected.

Adds XxeHardeningTestFixture with regression tests proving that a document with an external SYSTEM entity and a "billion laughs" entity-expansion document are both rejected (XmlException) rather than resolved. Existing sample-model loading tests continue to pass.

@github-actions
Copy link
Copy Markdown
Contributor

Package Line Rate Branch Rate Complexity Health
ECoreNetto 84% 74% 401
ECoreNetto.Extensions 99% 93% 101
ECoreNetto.HandleBars 99% 98% 60
ECoreNetto.Reporting 83% 70% 181
ECoreNetto.Tools 94% 87% 59
Summary 88% (2109 / 2393) 79% (473 / 596) 802

@sonarqubecloud
Copy link
Copy Markdown

@samatstariongroup samatstariongroup merged commit debc5ad into development May 31, 2026
14 checks passed
@samatstariongroup samatstariongroup deleted the GH29 branch May 31, 2026 19:13
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