Skip to content

🔒 Fix exported WatchSyncService vulnerability#25

Merged
Max97k merged 1 commit into
mainfrom
fix-exported-watchsyncservice-10926082899175185092
Jun 25, 2026
Merged

🔒 Fix exported WatchSyncService vulnerability#25
Max97k merged 1 commit into
mainfrom
fix-exported-watchsyncservice-10926082899175185092

Conversation

@Max97k

@Max97k Max97k commented Jun 22, 2026

Copy link
Copy Markdown
Owner

🎯 What: The WatchSyncService in the app/src/main/AndroidManifest.xml was explicitly exported without permission constraints.

⚠️ Risk: Being explicitly exported, this WearableListenerService could 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 WatchSyncService definition to set android: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

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>
@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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-critical critical

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">

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