Skip to content

πŸ”’ Validate tile overlay URL templates to require HTTP/HTTPS schemes - #19

Closed
esenmx wants to merge 1 commit into
masterfrom
fix/tile-overlay-url-validation-6475941354405381996
Closed

esenmx wants to merge 1 commit into
masterfrom
fix/tile-overlay-url-validation-6475941354405381996

Conversation

@esenmx

@esenmx esenmx commented Aug 22, 2026

Copy link
Copy Markdown
Owner

🎯 What: Fixed unvalidated URL template in tile overlay that allowed arbitrary URL schemes.
⚠️ Risk: Potential SSRF or local file access if unvalidated URL templates (such as file:// or arbitrary schemes) were passed to tile overlays.
πŸ›‘οΈ Solution: Added URL template scheme validation in Dart toPlatform() and Swift addTileOverlay to enforce http:// or https:// schemes.


PR created automatically by Jules for task 6475941354405381996 started by @esenmx

Validate URL templates in MKTileOverlay (Dart) and MapKitViewHost (Swift) to enforce https:// or http:// schemes and reject arbitrary or dangerous schemes like file://.

Co-authored-by: esenmx <43244505+esenmx@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@esenmx

esenmx commented Aug 23, 2026

Copy link
Copy Markdown
Owner Author

Closing: the premise does not hold. urlTemplate is written by the app developer in their own Dart code, not sourced from untrusted input, so there is no trust boundary for SSRF or local-file access to cross; the app already owns its sandbox. More importantly, file:// templates are a documented MapKit feature: Apple's MKTileOverlay.url(forTilePath:) states the default implementation builds the URL from the template you provide and "You can locate the tiles either on a local file system or on a remote server", which is how apps ship offline tile packs, and this package promises MKTileOverlay(urlTemplate:) parity. This change would break that use case for existing consumers while fixing no real vulnerability.

As implemented it also: rejects RFC 3986-valid uppercase schemes via case-sensitive startsWith/hasPrefix; throws inside the controller's _enqueue closure so addTileOverlay rejects with a raw ArgumentError, contradicting the documented "catch MapKitException for any map failure" contract; and duplicates an unreachable Swift guard that yields a different error type for the same condition.

@esenmx esenmx closed this Aug 23, 2026
@google-labs-jules

Copy link
Copy Markdown
Contributor

Closing: the premise does not hold. urlTemplate is written by the app developer in their own Dart code, not sourced from untrusted input, so there is no trust boundary for SSRF or local-file access to cross; the app already owns its sandbox. More importantly, file:// templates are a documented MapKit feature: Apple's MKTileOverlay.url(forTilePath:) states the default implementation builds the URL from the template you provide and "You can locate the tiles either on a local file system or on a remote server", which is how apps ship offline tile packs, and this package promises MKTileOverlay(urlTemplate:) parity. This change would break that use case for existing consumers while fixing no real vulnerability.

As implemented it also: rejects RFC 3986-valid uppercase schemes via case-sensitive startsWith/hasPrefix; throws inside the controller's _enqueue closure so addTileOverlay rejects with a raw ArgumentError, contradicting the documented "catch MapKitException for any map failure" contract; and duplicates an unreachable Swift guard that yields a different error type for the same condition.

Understood. Acknowledging that this task is not applicable as file:// URL templates are a documented MapKit feature for offline tiles and urlTemplate is developer-controlled without a trust boundary crossing. Stopping work on this task.

@esenmx
esenmx deleted the fix/tile-overlay-url-validation-6475941354405381996 branch October 3, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant