You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/quark_script.rst
+38-29Lines changed: 38 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1376,58 +1376,67 @@ Quark Script Result
1376
1376
1377
1377
1378
1378
Detect CWE-20 in Android Application
1379
-
----------------------------------------
1379
+
-------------------------------------
1380
1380
1381
1381
This scenario seeks to find **Improper Input Validation** in the APK file.
1382
1382
1383
-
CWE-20 Improper Input Validation
1384
-
=================================
1383
+
CWE-20: Improper Input Validation
1384
+
==================================
1385
1385
1386
1386
We analyze the definition of CWE-20 and identify its characteristics.
1387
1387
1388
1388
See `CWE-20 <https://cwe.mitre.org/data/definitions/20.html>`_ for more details.
1389
1389
1390
-
.. image:: https://imgur.com/21CzFUq.jpg
1390
+
.. image:: https://imgur.com/eO8fepu.jpg
1391
1391
1392
1392
Code of CWE-20 in diva.apk
1393
-
===============================
1393
+
===========================
1394
1394
1395
1395
We use the `diva.apk <https://github.com/payatu/diva-android>`_ sample to explain the vulnerability code of CWE-20.
1396
1396
1397
-
.. image:: https://imgur.com/kRIuEHd.jpg
1397
+
.. image:: https://imgur.com/nsuXYGU.jpg
1398
1398
1399
-
Quark Script CWE-20.py
1400
-
=======================
1399
+
CWE-20 Detection Process Using Quark Script API
1400
+
================================================
1401
+
1402
+
.. image:: https://imgur.com/C7zmwLm.jpg
1401
1403
1402
1404
Let’s use the above APIs to show how the Quark script finds this vulnerability.
1403
1405
1404
1406
First, we design a detection rule ``openUrlThatUserInput.json``, to spot the behavior of opening the URL that the user inputs. Then, we use API ``behaviorInstance.getMethodsInArgs()`` to get a list of methods that the URL in ``loadUrl`` passes through. Finally, we check if any validation method is in the list. If No, the APK does not validate user input. That causes CWE-20 vulnerability.
0 commit comments