Skip to content

Commit aac08fe

Browse files
authored
Optimize the showcase of Quark Script CWE-295
1 parent fbb0a3f commit aac08fe

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

CWE-295/CWE-295.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
"proceed", # method name
77
"()V" # descriptor
88
]
9-
OVERRIDE_METHOD = [
9+
OVERRIDDEN_METHOD = [
1010
"Landroid/webkit/WebViewClient;", # class name
1111
"onReceivedSslError", # method name
12-
"(Landroid/webkit/WebView;"+" Landroid/webkit/SslErrorHandler;" + \
12+
"(Landroid/webkit/WebView;" + " Landroid/webkit/SslErrorHandler;" + \
1313
" Landroid/net/http/SslError;)V" # descriptor
1414
]
1515

1616
for sslProceedCaller in findMethodInAPK(SAMPLE_PATH, TARGET_METHOD):
17-
if (sslProceedCaller.name == OVERRIDE_METHOD[1] and
18-
sslProceedCaller.descriptor == OVERRIDE_METHOD[2] and
19-
OVERRIDE_METHOD[0] in sslProceedCaller.findSuperclassHierarchy()):
20-
print(f"CWE-295 is detected in method, {sslProceedCaller.fullName}")
17+
if (
18+
sslProceedCaller.name == OVERRIDDEN_METHOD[1]
19+
and sslProceedCaller.descriptor == OVERRIDDEN_METHOD[2]
20+
and OVERRIDDEN_METHOD[0] in sslProceedCaller.findSuperclassHierarchy()
21+
):
22+
print(f"CWE-295 is detected in method, {sslProceedCaller.fullName}")

0 commit comments

Comments
 (0)