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
We analyze the definition of CWE-79 and identify its characteristics.
1478
1478
1479
1479
See `CWE-79 <https://cwe.mitre.org/data/definitions/79.html>`_ for more details.
1480
1480
1481
-
.. image:: https://imgur.com/jAwgD0x.png
1481
+
.. image:: https://imgur.com/3W1QpU1.png
1482
1482
1483
1483
Code of CWE-79 in Vuldroid.apk
1484
1484
===============================
1485
1485
1486
1486
We use the `Vuldroid.apk <https://github.com/jaiswalakshansh/Vuldroid>`_ sample to explain the vulnerability code of CWE-79.
1487
1487
1488
-
.. image:: https://imgur.com/lC6EKun.png
1488
+
.. image:: https://imgur.com/iv3Guwi.png
1489
1489
1490
-
Quark Script CWE-79.py
1491
-
=======================
1490
+
CWE-79 Detection Process Using Quark Script API
1491
+
================================================
1492
+
1493
+
.. image:: https://imgur.com/MpUjFP0.png
1492
1494
1493
1495
Let’s use the above APIs to show how the Quark script finds this vulnerability.
1494
1496
1495
1497
First, we design a detection rule ``loadUrlFromIntent.json`` to spot the behavior loading URL from intent data to the WebView instance.
1496
1498
1497
-
Next, we use API ``quarkResultInstance.findMethodInCaller(callerMethod, targetMethod)`` and ``methodInstance.getArguments()`` to check if the Javascript execution is enabled in the WebView. Finally, we check if there are any famous XSS filters. If NO, that may cause CWE-79 vulnerability.
1499
+
Next, we use API ``quarkResultInstance.findMethodInCaller(callerMethod, targetMethod)`` and ``methodInstance.getArguments()`` to check if the Javascript execution is enabled in the WebView. Finally, we check if there are any famous XSS filters. If **NO**, that may cause CWE-79 vulnerability.
1500
+
1501
+
Quark Script CWE-79.py
1502
+
=======================
1503
+
1504
+
.. image:: https://imgur.com/NyMpLZW.png
1498
1505
1499
1506
.. code-block:: python
1500
1507
@@ -1550,10 +1557,12 @@ Next, we use API ``quarkResultInstance.findMethodInCaller(callerMethod, targetMe
1550
1557
print(f"CWE-79 is detected in method, {caller.fullName}")
0 commit comments