Skip to content

Harden XML parsing via commons-secure-xml - #781

Draft
ppkarwasz wants to merge 1 commit into
masterfrom
feat/use-commons-xml
Draft

Harden XML parsing via commons-secure-xml#781
ppkarwasz wants to merge 1 commit into
masterfrom
feat/use-commons-xml

Conversation

@ppkarwasz

Copy link
Copy Markdown
Member

Warning

This PR was submitted automatically to smoke-test
Apache Commons Secure XML
and has not yet been verified by a human.
It will stay a draft until a committer reviews it and marks it ready.

Creates the document builder that parses providers.xml configuration files through org.apache.commons:commons-secure-xml (1.0.0-SNAPSHOT until its first release) in commons-vfs2. The secure factory enables XML secure processing and installs a non-removable entity-resolver floor: external DTD and entity lookups are resolved to empty content instead of being fetched, and internal entity expansion is bounded. Internal entities declared in a configuration file's own DTD subset still expand (setExpandEntityReferences stays on); only external content is affected. CI and CodeQL run with -Puse-apache-snapshots so the SNAPSHOT dependency resolves.

🤖 Generated with Claude Code

Create the document builder that parses providers.xml configuration
files through org.apache.commons:commons-secure-xml. The secure factory
enables FEATURE_SECURE_PROCESSING and installs a non-removable
entity-resolver floor on every parser it produces: external DTD and
entity lookups are resolved to empty content instead of being fetched,
and internal entity expansion is bounded, regardless of the JAXP
implementation on the classpath.

Changes:
- Add the commons-secure-xml dependency (1.0.0-SNAPSHOT until its first
  release) to commons-vfs2.
- Route factory creation through SecureDocumentBuilderFactory in
  StandardFileSystemManager. Internal entities declared in a
  configuration file's own DTD subset still expand
  (setExpandEntityReferences stays on); only external content is
  affected.
- Run the CI and CodeQL builds with -Puse-apache-snapshots (inherited
  from the org.apache:apache parent POM) so the commons-secure-xml
  SNAPSHOT resolves; CodeQL's autobuild receives the profile through
  MAVEN_ARGS.

Assisted-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MHgnMnGWHQoH2zD2jFdoMT
@ppkarwasz
ppkarwasz force-pushed the feat/use-commons-xml branch from e93dbcb to 1f65d1e Compare August 31, 2026 15:17
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