Skip to content

CommunityFragment loads maps.media.mit.edu over http instead of https #2314

Description

@jim-daf

CommunityFragment.onViewCreated (app/src/main/kotlin/io/treehouses/remote/fragments/CommunityFragment.kt:34) loads the community map WebView with a cleartext URL:

bind.map.settings.javaScriptEnabled = true
//bind.map.loadUrl("https://www.google.com/maps/d/u/0/viewer?ll=11.88717970130264%2C10.93123241891862&z=4&mid=1rO3RmHQnrSNsBwB9skqHos970zI-ZVAA")
bind.map.loadUrl("http://maps.media.mit.edu/remote.html")

The page is currently fetched as http://maps.media.mit.edu/remote.html, and the app keeps it working only because AndroidManifest.xml declares android:usesCleartextTraffic="true" for the whole package. Cleartext over WiFi means anyone on the path can see which page is being viewed and can inject content into the map page that runs with JavaScript enabled (this is the CWE-319 pattern Mutchler et al. call out for hybrid Android apps).

maps.media.mit.edu already serves the same page over https://, so the swap is a one-character change with no behavioural difference. A long-term follow-up would be to drop the global usesCleartextTraffic="true" once every cleartext call site has migrated.

Suggested fix

- bind.map.loadUrl("http://maps.media.mit.edu/remote.html")
+ bind.map.loadUrl("https://maps.media.mit.edu/remote.html")

A PR with the one-line change is open at #2315.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions