Skip to content

Android: Protect app from crashing due to unsafe input from 3rd parties #953

@cmonfortep

Description

@cmonfortep

Describe the bug
Our app can be launched from 3rd party apps, and we access an Intent which was created by the other app.

If the other app has a badly created Intent, or the calling app's process dies before we can process the Intent, it can cause our app to crash when trying to process it.

Other browsers have had to add a safety net around processing 3rd party intents previously

Potential fixes

  • Firefox fixes by wrapping all incoming Intents into a SafeIntent, which has try/catches embedded in it to prevent crashes.
  • Chrome runs all Intents through a sanitize method [preferred]
    • attempts to pull out an extra from the Intent.
    • the extra isn't there, but trying to get it will cause the exception to happen if the - Intent is malformed or invalid.
    • Returns an Intent with a nulled out extras bundle if exception is caught

Play Store:
Link to crashes
Number of users affected: low
Total occurrences: low

If applicable, please include information about any settings that may be relevant to this issue (e.g. selected theme, auto clear option, etc).

Expected behavior

  • Protect against our app crashing due to problems with 3rd party apps

Smartphone (please complete the following information):

  • DDG App Version: all versions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions