Skip to content

Fix XXE vulnerability in BlazeXmlSchema - #8355

Merged
LeFrosch merged 1 commit into
bazelbuild:masterfrom
LeFrosch:pull/2953ceefff45920f6f792890037a5adb009ab9e4
Jun 9, 2026
Merged

Fix XXE vulnerability in BlazeXmlSchema#8355
LeFrosch merged 1 commit into
bazelbuild:masterfrom
LeFrosch:pull/2953ceefff45920f6f792890037a5adb009ab9e4

Conversation

@LeFrosch

@LeFrosch LeFrosch commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

PiperOrigin-RevId: 928558080
Copybara PR: #8353

PiperOrigin-RevId: 928558080

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request enhances XML parsing security in BlazeXmlSchema.java by configuring SAXParserFactory with secure features to prevent XML External Entity (XXE) vulnerabilities. The review feedback suggests enabling namespace awareness on the SAXParserFactory to avoid potential mapping issues with namespaced XML.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

public static TestSuite parse(InputStream input) {
try {
Object parsed = CONTEXT.createUnmarshaller().unmarshal(input);
SAXParserFactory spf = SAXParserFactory.newInstance();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

By default, SAXParserFactory is not namespace-aware. When unmarshalling XML using JAXB via a SAXSource, namespace awareness should be enabled to prevent potential mapping failures if the XML contains namespaces.

Suggested change
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);

@LeFrosch
LeFrosch marked this pull request as ready for review June 9, 2026 13:25
@LeFrosch
LeFrosch requested review from mai93 and ujohnny as code owners June 9, 2026 13:25
@github-actions github-actions Bot added product: CLion CLion plugin product: IntelliJ IntelliJ plugin product: GoLand GoLand plugin awaiting-review Awaiting review from Bazel team on PRs labels Jun 9, 2026
@LeFrosch
LeFrosch merged commit bb02c3d into bazelbuild:master Jun 9, 2026
8 checks passed
@LeFrosch
LeFrosch deleted the pull/2953ceefff45920f6f792890037a5adb009ab9e4 branch June 9, 2026 14:57
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in Bazel IntelliJ Plugin Jun 9, 2026
@github-actions github-actions Bot removed the awaiting-review Awaiting review from Bazel team on PRs label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin

Projects

Development

Successfully merging this pull request may close these issues.

3 participants