Add setting controlling whether kml may come from outside the wiki - #931
Merged
Conversation
KML documents named by the `kml` parameter are fetched by the browser of everyone viewing the map, so the host they come from learns every reader's IP address and user agent, and can change what it serves after the edit was reviewed. A KML document names further documents of its own through `NetworkLink` and `styleUrl`, so the host need not appear in the wikitext at all. `$egMapsAllowExternalKml` (and `general.allowExternalKml` on `MediaWiki:Maps`) drops `kml` values that are not a file on the wiki, and, through the map data, has geoxml3 fetch only same-origin documents. It defaults to true, keeping today's behaviour, since changing it would break existing wikis. Whether to flip that default is a separate decision. `NetworkLink` elements are now followed at most three levels deep regardless of the setting. geoxml3 had no limit, so a document linking back to itself made the browser fetch in an unbounded loop. `gkml` is left alone: `google.maps.KmlLayer` documents are fetched and rendered by Google's servers, not by the reader's browser, so neither the IP leak nor the recursion applies. Co-Authored-By: Claude Fable 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.
The default is
true, keeping today's behaviour, since flipping it would break existing wikis on aminor release. Whether to make
falsethe default is your call, not something this PR decides.gkmlis deliberately left alone:google.maps.KmlLayerdocuments are fetched and rendered byGoogle's servers rather than by the reader's browser, so neither the IP leak nor the
NetworkLinkrecursion applies to it.
The nesting limit on
NetworkLinkapplies regardless of the setting, since an unbounded fetch loopis a problem on its own.