Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling my link when not logged in #3826

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

jpelgrom
Copy link
Member

Summary

Prevent unexpected behavior when using MyActivity outside the happy flow.

Screenshots

n/a

Link to pull request in Documentation repository

n/a

Any other notes

Copy link
Member

@dshokouhi dshokouhi left a comment

Choose a reason for hiding this comment

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

Good to be specific here

@JBassett JBassett merged commit 201931b into home-assistant:master Aug 28, 2023
@jpelgrom jpelgrom deleted the my-handle-no-server branch August 28, 2023 21:43
@firmianay
Copy link

Hello developers,
This patch appears to address this vulnerability, and GitHub Security Lab has not released their report yet.
I have some questions, because the manifest has already restricted the Intent that calls this component. Why do I need to check it again in the code, Or is this just a casual thing, The main vulnerability mitigation point is !serverManager.isRegistered()?

        <activity android:name=".launch.my.MyActivity"
            android:exported="true">
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:scheme="https"
                    android:host="my.home-assistant.io"
                    android:pathPrefix="/redirect/"/>
            </intent-filter>
        </activity>

@jpelgrom
Copy link
Member Author

jpelgrom commented Dec 4, 2023

@firmianay GHSL has released a blog post with details now. While during normal use the added check is unnecessary, the specific domain check is to prevent the described, targeted use of this activity to load another URL and gain access to the app's webview.

If you have any more questions after reading the blog post, feel free to ask in #devs_mobile_apps on the Home Assistant Discord.

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

Successfully merging this pull request may close these issues.

4 participants