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
This scenario seeks to find **External Control of File Name or Path**. See
1921
+
`CWE-73<https://cwe.mitre.org/data/definitions/73.html>`__ for more
1922
+
details.
1923
+
1924
+
First, we design a detection rule ``accessFileInExternalDir.json`` to spot behavior accessing a filein an external directory.
1925
+
1926
+
Second, we use API``methodInstance.getArguments()`` to get the argument for the file path and use ``quarkResultInstance.isHardcoded(argument)`` to check if the argument is hardcoded into the APK. If **No**, the argument isfrom external input.
1927
+
1928
+
Finally, we use Quark API``quarkResultInstance.findMethodInCaller(callerMethod, targetMethod)`` to check ifany APIs in the caller method for opening files. If **YES**, the APK performs file operations using external inputas a path, which may cause CWE-73 vulnerability.
0 commit comments