Commit 13c9af7
committed
fix(xml): harden VendorExtensions XElement parse against XXE
Explicitly pin DtdProcessing.Prohibit and XmlResolver = null when
parsing each captured vendor-extension element's OuterXml back into an
XElement, mirroring the repo-wide defense-in-depth convention already
established in XmiDeserializer.FromXml/FromFile.
.NET 6+ already defaults XmlResolver to null and disables DTD
processing on the outer document read, and a DOCTYPE cannot legally
appear inside a captured element's OuterXml, so this closes a
consistency gap rather than an exploitable path today — but it
survives a future framework downgrade or accidental restoration of
XmlUrlResolver, and keeps every XML parse entry point in the repo on
the same explicit hardening idiom.
Found by the security-audit pass of the PR TrakHound#223 dime review cycle.1 parent 41567a2 commit 13c9af7
1 file changed
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
149 | | - | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
160 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
161 | 178 | | |
162 | 179 | | |
163 | 180 | | |
| |||
0 commit comments