Add Quark script showcase of detecting CWE-927#807
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #807 +/- ##
=======================================
Coverage 81.10% 81.10%
=======================================
Files 75 75
Lines 6372 6372
=======================================
Hits 5168 5168
Misses 1204 1204
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
haeter525
requested changes
Sep 10, 2025
haeter525
approved these changes
Sep 10, 2025
This was referenced Nov 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detect CWE-927 in Android Application
This scenario seeks to find Use of Implicit Intent for Sensitive Communication.
CWE-927: Use of Implicit Intent for Sensitive Communication
We analyze the definition of CWE-927 and identify its characteristics.
See CWE-927 for more details.
Code of CWE-927 in ovaa.apk
We use the ovaa.apk sample to explain the vulnerability code of CWE-927.
CWE-927 Detection Process Using Quark Script API
First, we design a detection rule
startActivityWithIntent.jsonto identify the behavior of using an intent to start an activity.Then, we use the API
behaviorInstance.getMethodsInArgs()to retrieve a list of methods that prepare an intent.Finally, we check whether any component setting method is present in the list. If none is found, it indicates that the APK is using an implicit intent, which may lead to a CWE-927 vulnerability.
Quark Script CWE-927.py
Quark Rule: startActivityWithIntent.json
{ "crime": "Start Activity With Intent.", "permission": [], "api": [ { "descriptor": "(Landroid/content/Context;Ljava/lang/Class;)V", "class": "Landroid/content/Intent;", "method": "<init>" }, { "descriptor": "(Landroid/content/Intent;)V", "class": "", "method": "startActivity" } ], "score": 1, "label": [] }Quark Script Result