File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -307,6 +307,7 @@ def assetlinks_check(self, intent):
307
307
"""Well known assetlink check."""
308
308
iden = 'sha256_cert_fingerprints'
309
309
well_known_path = '/.well-known/assetlinks.json'
310
+ rule = 'android_manifest_well_known_assetlinks'
310
311
well_knowns = set ()
311
312
312
313
applink_data = intent .get ('data' )
@@ -327,18 +328,24 @@ def assetlinks_check(self, intent):
327
328
well_knowns .add (c_url )
328
329
for w_url in well_knowns :
329
330
try :
331
+ status = True
330
332
r = requests .get (
331
333
w_url ,
332
- allow_redirects = True )
334
+ allow_redirects = True ,
335
+ timeout = 5 )
333
336
if not (str (r .status_code ).startswith ('2' )
334
337
and iden in str (r .json ())):
335
- add_finding (
336
- self .findings ,
337
- self .xml_path ,
338
- 'android_manifest_well_known_assetlinks' ,
339
- (w_url , r .status_code ))
338
+ status = False
339
+ rcode = r .status_code
340
340
except Exception :
341
- pass
341
+ status = False
342
+ rcode = 0
343
+ if not status :
344
+ add_finding (
345
+ self .findings ,
346
+ self .xml_path ,
347
+ rule
348
+ (w_url , rcode ))
342
349
343
350
344
351
class TaskHijackingChecks :
You can’t perform that action at this time.
0 commit comments