Repository navigation
Conversation
ST_GeomFromGML used JTS's GMLReader, which creates a plain SAX parser with external entity resolution enabled. It now parses the GML with a SAX parser from Apache Commons Secure XML, which does not fetch external DTDs or entities, and passes the events to JTS's GMLHandler. The parser is not namespace-aware, like GMLReader, so GML fragments with an undeclared "gml:" prefix, such as the output of ST_AsGML, are still accepted. A forbidden-apis rule rejects GMLReader and the plain JAXP SAX factory methods. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
|
Gradle may run on Java 8 or 11, where signatures of the Java 9 and 13 SAXParserFactory methods fail to parse. Code compiled for Java 8 cannot call those methods anyway. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Jira Link
CALCITE-7601
Changes Proposed
Note
This is a fallback PR. The preferred fix is upstream in JTS, where
GMLReaderwould create its parser through Apache Commons Secure XML: locationtech/jts#1230. This PR is only needed if JTS does not adopt that change, or if Calcite cannot wait for a JTS release that includes it.ST_GeomFromGMLno longer uses JTS'sGMLReader, whose SAX parser resolves external entities. It parses the GML with a SAX parser from Apache Commons Secure XML 1.0.0, which does not fetch external DTDs or entities, and passes the events to JTS's ownGMLHandler.GMLReader, so GML fragments with an undeclaredgml:prefix, such as the output ofST_AsGML, are still accepted.GMLReaderand the plain JAXP SAX factory methods, so the unsecured path cannot come back.🤖 Generated with Claude Code