Skip to content

XXE warning for JAXP - #1467

Merged
labkey-jeckels merged 2 commits into
release26.7-SNAPSHOTfrom
26.7_fb_schemaFactoryConfig
Aug 8, 2026
Merged

XXE warning for JAXP#1467
labkey-jeckels merged 2 commits into
release26.7-SNAPSHOTfrom
26.7_fb_schemaFactoryConfig

Conversation

@labkey-jeckels

Copy link
Copy Markdown
Contributor

Rationale

We want to avoid introducing new XXE problems in the future.

Related Pull Requests

Changes

  • IntelliJ warning to prevent use for future non-hardened SchemaFactories

@labkey-jeckels labkey-jeckels added this to the 26.07 milestone Aug 7, 2026
@labkey-jeckels
labkey-jeckels requested a review from a team August 7, 2026 02:31
@labkey-jeckels labkey-jeckels self-assigned this Aug 7, 2026

@labkey-bpatel labkey-bpatel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, but please take a look at my comments.

<searchConfiguration name="XMLInputFactory.newInstance()" text="javax.xml.parsers.DocumentBuilderFactory.newInstance()" recursive="true" caseInsensitive="true" type="JAVA" pattern_context="default">
<constraint name="__context__" within="" contains="" />
</searchConfiguration>
<searchConfiguration name="SchemaFactory.newInstance()" description="XML parsers should always be configured to protect against XXE — use XmlBeansUtil.getHardenedSchemaFactory()" suppressId="SchemaFactory" text="javax.xml.validation.SchemaFactory.newInstance($schemaLanguage$)" recursive="true" caseInsensitive="true" type="JAVA" pattern_context="default">

@labkey-bpatel labkey-bpatel Aug 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the description should say use XmlBeansUtil.schemaFactory() instead of use XmlBeansUtil.getHardenedSchemaFactory(). I don't see a getHardenedSchemaFactory() method in XmlBeansUtil.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to match the final method name.

@@ -1,6 +1,5 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this removal intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seemed harmless (I don't know what it does) but I restored it, just in case.

@labkey-jeckels
labkey-jeckels merged commit 8dadb52 into release26.7-SNAPSHOT Aug 8, 2026
7 of 9 checks passed
@labkey-jeckels
labkey-jeckels deleted the 26.7_fb_schemaFactoryConfig branch August 8, 2026 00:46
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.

2 participants