-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Port MASTG-TEST-0026: Testing Implicit Intents (android) (by @appknox) #3271
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
base: master
Are you sure you want to change the base?
Conversation
@cpholguera Please review. This format is slightly different, so please let me know the changes that are needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ScreaMy7 ! Thanks for contributing!
This PR is mixing up two different things though. Implicit intents are an issue because they can be intercepted by other applications, thereby possible intercepting sensitive information. While the explanation seems to be correct, the demo itself doesn't show the vulnerability. Can you please update the code to showcase the vulnerability?
@TheDauntless Thanks for the review. Have you tried the dynamic demo, which has an attacker application to trigger the intent redirect to the internal parts of the vulnerable application? Could you please explain more about the mix-up? |
Either the explanation of the test is wrong, or the implementation. This test is about implicit intent interception so the demo would be:
Result: The user can choose between the legitimate app and the attacker app, and the sensitive data would leak if they choose the attacker app Your demo describes the attacker intercepting data, but data isn't intercepted anywhere? You're just triggering an implicit activity with an explicit intent; all the data stays inside of the vulnerableapp. Where is the attack? What you are describing is something that Android fixes itself in Android 15: https://developer.android.com/about/versions/15/behavior-changes-15#safer-intents |
Hi @TheDauntless , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ports the deprecated MASTG-TEST-0026 (Testing Implicit Intents) to MASTG V2 format by creating two new tests that cover different aspects of implicit intent vulnerabilities. The change maintains backward compatibility by marking the original test as deprecated while providing comprehensive coverage through static and dynamic analysis approaches.
- Deprecates MASTG-TEST-0026 and creates MASTG-TEST-0287 (static analysis) and MASTG-TEST-0286 (dynamic analysis)
- Adds comprehensive demonstration files showing both vulnerable code patterns and exploitation techniques
- Includes Semgrep rule for automated detection of exported activities with custom intent filters
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
tests/android/MASVS-CODE/MASTG-TEST-0026.md | Marks original test as deprecated with references to new tests |
tests-beta/android/MASVS-CODE/MASTG-TEST-0287.md | New static analysis test for implicit intent vulnerabilities |
tests-beta/android/MASVS-CODE/MASTG-TEST-0286.md | New dynamic analysis test for implicit intent interception |
rules/mastg-android-custom-intent-intecept.yml | Semgrep rule for detecting vulnerable intent filter configurations |
demos/android/MASVS-CODE/MASTG-DEMO-0059/ | Static analysis demonstration with Semgrep output |
demos/android/MASVS-CODE/MASTG-DEMO-0058/ | Dynamic analysis demonstration with vulnerable and attacker code |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@@ -0,0 +1,28 @@ | |||
--- | |||
title: Implicit intent to intecept internal app components |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the title: 'intecept' should be 'intercept'.
title: Implicit intent to intecept internal app components | |
title: Implicit intent to intercept internal app components |
Copilot uses AI. Check for mistakes.
@@ -0,0 +1,2 @@ | |||
# shellcheck disable=SC2148 | |||
NO_COLOR=true semgrep -c ../../../../rules/mastg-android-custom-intent-filter-intercept.yml ../MASTG-DEMO-0058/AndroidManifest_reversed.xml --text -o output.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The referenced rule file 'mastg-android-custom-intent-filter-intercept.yml' doesn't match the actual filename 'mastg-android-custom-intent-intecept.yml'. This will cause the semgrep command to fail.
NO_COLOR=true semgrep -c ../../../../rules/mastg-android-custom-intent-filter-intercept.yml ../MASTG-DEMO-0058/AndroidManifest_reversed.xml --text -o output.txt | |
NO_COLOR=true semgrep -c ../../../../rules/mastg-android-custom-intent-intecept.yml ../MASTG-DEMO-0058/AndroidManifest_reversed.xml --text -o output.txt |
Copilot uses AI. Check for mistakes.
|
||
Let's run our @MASTG-TOOL-0110 rule against the manifest file and code. | ||
|
||
{{ ../../../../rules/mastg-android-custom-intent-filter-intercept.yml }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The referenced rule file path 'mastg-android-custom-intent-filter-intercept.yml' doesn't match the actual filename 'mastg-android-custom-intent-intecept.yml'. This will result in a broken reference.
{{ ../../../../rules/mastg-android-custom-intent-filter-intercept.yml }} | |
{{ ../../../../rules/mastg-android-custom-intent-intecept.yml }} |
Copilot uses AI. Check for mistakes.
@@ -0,0 +1,25 @@ | |||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |||
package="com.example.datainteceptor"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the package name: 'datainteceptor' should be 'datainterceptor' to match the correct spelling of 'interceptor'.
package="com.example.datainteceptor"> | |
package="com.example.datainterceptor"> |
Copilot uses AI. Check for mistakes.
@@ -0,0 +1,15 @@ | |||
package com.example.datainteceptor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the package name: 'datainteceptor' should be 'datainterceptor' to match the correct spelling of 'interceptor'.
package com.example.datainteceptor | |
package com.example.datainterceptor |
Copilot uses AI. Check for mistakes.
@@ -0,0 +1,24 @@ | |||
package com.example.datainteceptor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the package name: 'datainteceptor' should be 'datainterceptor' to match the correct spelling of 'interceptor'.
package com.example.datainteceptor | |
package com.example.datainterceptor |
Copilot uses AI. Check for mistakes.
closes #2997