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-921 and identify its characteristics.
595
595
596
596
See `CWE-921 <https://cwe.mitre.org/data/definitions/921.html>`_ for more details.
597
597
598
-
.. image:: https://imgur.com/ihtjGAu.jpg
598
+
.. image:: https://imgur.com/2zlPLHe.jpg
599
+
599
600
600
601
Code of CWE-921 in ovaa.apk
601
-
=========================================
602
+
============================
603
+
602
604
We use the `ovaa.apk <https://github.com/oversecured/ovaa>`_ sample to explain the vulnerability code of CWE-921.
603
605
604
-
.. image:: https://imgur.com/ACzJct8.jpg
606
+
.. image:: https://imgur.com/2u5iL1K.jpg
605
607
606
-
Quark Script: CWE-921.py
607
-
=========================
608
+
CWE-921 Detection Process Using Quark Script API
609
+
=================================================
610
+
611
+
.. image:: https://imgur.com/qHOMqKy.jpg
608
612
609
613
Let’s use the above APIs to show how the Quark script finds this vulnerability.
610
614
611
615
First, we design a detection rule ``checkFileExistence.json`` to spot on behavior that checks if a file exists on a given storage mechanism. Then, we use API ``methodInstance.getArguments()`` to get the file path. Finally, CWE-921 is found if the file path contains the keyword ``sdcard``.
612
616
617
+
Quark Script: CWE-921.py
618
+
========================
619
+
620
+
.. image:: https://imgur.com/HULgyIy.jpg
621
+
613
622
.. code-block:: python
614
623
615
624
from quark.script import runQuarkAnalysis, Rule
@@ -626,9 +635,11 @@ First, we design a detection rule ``checkFileExistence.json`` to spot on behavio
0 commit comments