Skip to content

Fix KMLReader XML parser security hole - #1204

Merged
dr-jts merged 1 commit into
locationtech:masterfrom
dr-jts:fix-kmlreader-security
Jun 17, 2026
Merged

Fix KMLReader XML parser security hole#1204
dr-jts merged 1 commit into
locationtech:masterfrom
dr-jts:fix-kmlreader-security

Conversation

@dr-jts

@dr-jts dr-jts commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Fixes teh KMLReader usage of XML parser to avoid exposure to the XXE security hole.

The original report said:

We discovered that there’s lack of hardening for XXE for the KMLReader (jts-core).

Problem: The class initialises its XMLInputFactory via XMLInputFactory.newInstance() at field declaration (modules/core/src/main/java/org/locationtech/jts/io/kml/KMLReader.java and never sets SUPPORT_DTD or IS_SUPPORTING_EXTERNAL_ENTITIES. None of the four public constructors accept a caller-supplied factory either, so a consumer cannot harden it from outside.

Impact: This leads to an XXE vulnerability in a project depending on the KMLReader.

Potential fix: KML geometry has no legitimate use for DTDs or external entities, so this should not change behaviour for valid input.

@dr-jts
dr-jts merged commit 7f7cb3f into locationtech:master Jun 17, 2026
2 checks passed
@dr-jts
dr-jts deleted the fix-kmlreader-security branch June 17, 2026 21:57
@dr-jts dr-jts changed the title Fix KMLReader XMLParser security hole Fix KMLReader XML parser security hole Jun 17, 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