Optimize the document of Quark Script CWE-312#717
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #717 +/- ##
=======================================
Coverage 79.22% 79.22%
=======================================
Files 73 73
Lines 5732 5732
=======================================
Hits 4541 4541
Misses 1191 1191
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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-312 in Android Application
This scenario seeks to find cleartext storage of sensitive data in the APK file.
CWE-312: Cleartext Storage of Sensitive Information
We analyze the definition of CWE-312 and identify its characteristics.
See CWE-312 for more details.
Code of CWE-312 in ovaa.apk
We use the ovaa.apk sample to explain the vulnerability code of CWE-312.
CWE-312 Detection Process Using Quark Script API
Let’s use the above APIs to show how the Quark script finds this vulnerability.
We have designed a Frida script
agent.jsto hook a specified method and get the arguments when the method is called. It can be found in quark-engine/quark/script/frida.To begin with, we hook the method
putStringto catch its arguments. Then, we check if sensitive information like email or password is passed. Finally, we usecheckClearTextimported from Ares to check if the arguments are cleartext. If both YES, CWE-312 vulnerability might be caused.Quark Script: CWE-312.py
Frida Script: agent.js
Quark Script Result