-
-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Non-Interactive Execution of android::action:onReceive:intentUrl Opens Large Attack Surface and Should be Optional #227
Comments
Sounds reasonable, I'm open to accept PRs for this. |
I'll try, when I have time, but it will take a while, since I'm not an android nor a java developer. If someone experienced wants to help it'll be appreciated. |
From a security perspective that makes absolute sense. @jmattheis What do you think, should we make it the default to show a confirmation dialog? |
@cyb3rko Yeah, a confirmation dialog sounds fine. If that's not easily possible, then I'd be okay with having this functionality opt-in, so it's disabled per default, and you can enable it inside the settings. |
I wanted to start implementing it, but thinking about the implementation I found a few problems we have to solve.
Some thoughts about this:
What do you think? |
No, for that a separate features request exists: gotify/server#494
No, that would work against the specification of the onReceive feature. As defined, the intend should be executed when receiving the message, not when clicking the notification.
I'd prefer having only one fix for this issue. I'm probably also okay with removing this onReceive feature completely because I don't think there are many use-cases for it. |
So you would only go with the settings toggle? |
Yes, or only the dialog like you proposed. Only the dialog is probably better, because then we can tell the user what the receive action does. |
Then we have the mentioned problem: |
Nothing I guess, currently the functionality only works if the gotify app is in focus. So, nothing happens, if gotify is running in the background. I'm not sure if you can show a dialog if the app isn't in focus. So the only real fix would be a button on the notification, but that's the other ticket I've linked. |
Showing a dialog without focus is not possible. |
Current Behaviour
If a sender uses
android::action:onReceive:intentUrl
, the receiving android application, as documented, executes this intent on the device, without user interaction, if the application is in foreground.Example message from the docs:
What happens technically, is that a new Intent is generated, the Intent data is set to URI-parsed sender input, and
startActivity
is called on the newly generated intent.Code taken from WebSocketService.java
Why This is a Problem
I would argue that this is insecure behaviour. It enables an remote actor, who is able to send messages on the specific application, to execute (URL-based) intents, which can trigger various actions on the device, which might not be in favor of the user. This opens an huge attack surface on the receiving device, amplified by the fact that the execution does not require user interaction, if the application is in foreground.
Proposed Solution
The introducing issue #92 and PRs #98 and #102 line out, that this feature is important for some users, so it should be kept. But i would suggest that it should be an optional feature, that the user need to actively turn on in the settings, which is currently, at least to my observations, not the case. The standard beahaviour should be, that no intent is executed without user interaction. I would further propose that every action but just displaying the message should be and remain optional for reducing the attack surface.
The text was updated successfully, but these errors were encountered: