You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow external kml and geojson files from an allowlist of hosts #945
Since 15.0.0 the kml and geojson parameters load only files that are on the wiki, unless $egMapsAllowExternalDataFiles is set to true, which allows any URL again. Wikis that depend on one or two trusted sources, such as an open-data portal or their own file server, have no middle ground: they either lose those maps or accept every host.
Proposal
A setting that lists the hosts external data files may come from, for example:
A URL in kml or geojson loads if $egMapsAllowExternalDataFiles is true, as now, or if its host matches the list. The default is an empty list, so nothing changes for existing wikis.
Entries are host names, and a leading *. covers subdomains.
The list applies to both paths: KML fetched by the viewer's browser and GeoJSON fetched by the server. The existing server-side safeguards, blocked private address ranges and pinned DNS, stay in force for listed hosts, and a redirect to a host outside the list is not followed.
NetworkLink elements inside a KML document follow the same list.
MediaWiki:Maps gets a counterpart, general.allowedDataFileHosts, like the other settings.
MediaWiki core has the same pattern in $wgCopyUploadsDomains for upload by URL, whose matching rules could be reused.
Activity