Skip to content

Comments

[Repo Assist] Set DtdProcessing.Parse explicitly as the default for XML parsing#1636

Closed
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/dtd-processing-parse-daa58c23503b10f5
Closed

[Repo Assist] Set DtdProcessing.Parse explicitly as the default for XML parsing#1636
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/dtd-processing-parse-daa58c23503b10f5

Conversation

@github-actions
Copy link
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Sets DtdProcessing = DtdProcessing.Parse explicitly in XmlElement.Create and XmlElement.CreateList in XmlRuntime.fs.

Context

DtdProcessing.Parse is the default on .NET Core (unlike .NET Framework where DtdProcessing.Prohibit is the default). This was the effective behavior before the XXE fix PR (#1596) that was reverted in #1633. Making the setting explicit:

  • Documents the intended behavior clearly in code
  • Ensures the same behavior regardless of any future framework default changes
  • Reflects what dsyme requested: "Make the default DtdProcessing.Parse given that is the default on .NET Core and was the default before the thing we had to revert"

Changes

  • Added open System.Xml to imports in XmlRuntime.fs
  • XmlElement.Create(reader: TextReader): now uses XmlReader with XmlReaderSettings(DtdProcessing = DtdProcessing.Parse) before loading into XDocument
  • XmlElement.CreateList(reader: TextReader): same — uses XmlReader with explicit DtdProcessing.Parse settings

Test Status

✅ Build succeeded
✅ All 69 XML tests passed (dotnet test --filter "Xml")

Generated by Repo Assist

To install this workflow, run gh aw add githubnext/agentics/workflows/repo-assist.md@828ac109efb43990f59475cbfce90ede5546586c. View source at https://github.com/githubnext/agentics/tree/828ac109efb43990f59475cbfce90ede5546586c/workflows/repo-assist.md.

DtdProcessing.Parse is the default on .NET Core and was the behavior
before the XXE fix that was reverted (#1633). Making this explicit
ensures the intended behavior is clear and documented in code.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor Author

✅ Pull request created: #1636

@dsyme dsyme closed this Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant