🔒 Fix exported WatchSyncService vulnerability#25
Conversation
Changed `android:exported="true"` to `android:exported="false"` for `WatchSyncService` in `AndroidManifest.xml` to prevent unauthorized triggering from other apps. Co-authored-by: Max97k <14903047+Max97k@users.noreply.github.com>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request modifies the AndroidManifest.xml to set android:exported="false" on the WatchSyncService. The reviewer points out that this change will break Wear OS communication because Google Play services won't be able to bind to the service. The recommended solution is to keep the service exported but restrict access using the BIND_PLAY_SERVICES permission.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| android:name=".service.WatchSyncService" | ||
| android:enabled="true" | ||
| android:exported="true"> | ||
| android:exported="false"> |
There was a problem hiding this comment.
Setting android:exported="false" on a WearableListenerService will prevent Google Play services from binding to it, which completely breaks the communication between the Wear OS watch and the handheld app.
To secure this service without breaking its functionality, keep android:exported="true" and restrict access by adding the android:permission="com.google.android.gms.permission.BIND_PLAY_SERVICES" attribute. This ensures that only Google Play services can bind to the service.
android:exported="true"
android:permission="com.google.android.gms.permission.BIND_PLAY_SERVICES">
🎯 What: The
WatchSyncServicein theapp/src/main/AndroidManifest.xmlwas explicitly exported without permission constraints.WearableListenerServicecould be bound to or triggered by any unauthorized application on the user's handheld device. An attacker could potentially start or stop location tracking sessions unexpectedly, leading to tracking without user knowledge or interference with desired tracking sessions.🛡️ Solution: Modified the
WatchSyncServicedefinition to setandroid:exported="false". Since it is an internal service responding to the Wear OS data layer, it doesn't need to be fully exported to other apps on the device, mitigating the vulnerability while preserving functionality.PR created automatically by Jules for task 10926082899175185092 started by @Max97k