Skip to content

Commit ef0fffd

Browse files
authored
Optimize the CWE-319 document (ev-flow#654)
* Optimize the CWE-319 document * Optimize the CWE-319 document
1 parent 48838d4 commit ef0fffd

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

docs/source/quark_script.rst

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,17 +1145,33 @@ Quark Script Result
11451145
$ python3 CWE-780.py
11461146
CWE-780 is detected in method, Lsg/vp/owasp_mobile/OMTG_Android/OMTG_DATAST_001_KeyStore; encryptString (Ljava/lang/String;)V
11471147
1148-
Detect CWE-319 in Android Application (ovaa.apk)
1149-
-------------------------------------------------------------
1148+
Detect CWE-319 in Android Application
1149+
-------------------------------------
11501150

1151-
This scenario seeks to find **the Cleartext Transmission of Sensitive Information**. See `CWE-319 <https://cwe.mitre.org/data/definitions/319.html>`_ for more details.
1151+
This scenario seeks to find **Cleartext Transmission of Sensitive Information** in the APK file.
11521152

1153-
Let's use this `APK <https://github.com/oversecured/ovaa>`_ and the above APIs to show how the Quark script finds this vulnerability. This sample uses the package Retrofit to request Web APIs, but the APIs use cleartext protocols.
1153+
CWE-319 Cleartext Transmission of Sensitive Information
1154+
========================================================
11541155

1155-
We first design a detection rule ``setRetrofitBaseUrl.json`` to spot on behavior that sets the base URL of the Retrofit instance. Then, we loop through a custom list of cleartext protocol schemes and use API ``behaviorInstance.hasString(pattern, isRegex)`` to filter arguments that are URL strings with cleartext protocol.
1156+
We analyze the definition of CWE-319 and identify its characteristics.
11561157

1157-
Quark Script CWE-319.py
1158-
=======================
1158+
See `CWE-319 <https://cwe.mitre.org/data/definitions/319.html>`_ for more details.
1159+
1160+
.. image:: https://imgur.com/tk8rtYf.jpg
1161+
1162+
Code of CWE-319 in ovaa.apk
1163+
============================
1164+
1165+
We use the `ovaa.apk <https://github.com/oversecured/ovaa>`_ sample to explain the vulnerability code of CWE-319.
1166+
1167+
.. image:: https://imgur.com/Ew4UOAR.jpg
1168+
1169+
Quark Scipt: CWE-319.py
1170+
========================
1171+
1172+
Let's use the above APIs to show how the Quark script finds this vulnerability. This sample uses the package Retrofit to request Web APIs, but the APIs use cleartext protocols.
1173+
1174+
We first design a detection rule ``setRetrofitBaseUrl.json`` to spot on behavior that sets the base URL of the Retrofit instance. Then, we loop through a custom list of cleartext protocol schemes and use API ``behaviorInstance.hasString(pattern, isRegex)`` to filter arguments that are URL strings with cleartext protocol.
11591175

11601176
.. code-block:: python
11611177

0 commit comments

Comments
 (0)