Skip to content

Commit 17332e8

Browse files
dmarushkinDmitry Maryushkinajinabraham
authored
Save only unique intent priorities in findings (#2474)
* Save only unique intent priorities in findings * Save only unique intent priorities in findings * Save only unique intent priorities in findings * Save only unique intent priorities in findings --------- Co-authored-by: Dmitry Maryushkin <[email protected]> Co-authored-by: Ajin Abraham <[email protected]>
1 parent fbf5674 commit 17332e8

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

mobsf/StaticAnalyzer/views/android/kb/android_manifest_desc.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,12 @@
219219
'name': 'Data SMS Receiver Set on Port: %s Found. [android:port]',
220220
},
221221
'high_intent_priority_found': {
222-
'title': 'High Intent Priority (%s)<br>[android:priority]',
222+
'title': 'High Intent Priority (%s) - {%s} Hit(s)<br>[android:priority]',
223223
'level': 'warning',
224224
'description': ('By setting an intent priority higher than another'
225225
' intent, the app effectively overrides '
226226
'other requests.'),
227-
'name': 'High Intent Priority (%s). [android:priority]',
227+
'name': 'High Intent Priority (%s) - {%s} Hit(s) [android:priority]',
228228
},
229229
'high_action_priority_found': {
230230
'title': 'High Action Priority (%s)<br>[android:priority] ',

mobsf/StaticAnalyzer/views/android/manifest_analysis.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -761,12 +761,18 @@ def manifest_analysis(app_dic, man_data_dic):
761761
dataport = data.getAttribute(f'{ns}:port')
762762
ret_list.append(('sms_receiver_port_found', (dataport,), ()))
763763
# INTENTS
764+
processed_priorities = {}
764765
for intent in intents:
765766
if intent.getAttribute(f'{ns}:priority').isdigit():
766767
value = intent.getAttribute(f'{ns}:priority')
767768
if int(value) > 100:
768-
ret_list.append(
769-
('high_intent_priority_found', (value,), ()))
769+
if value not in processed_priorities:
770+
processed_priorities[value] = 1
771+
else:
772+
processed_priorities[value] += 1
773+
for priority, count in processed_priorities.items():
774+
ret_list.append(
775+
('high_intent_priority_found', (priority, count,), ()))
770776
# ACTIONS
771777
for action in actions:
772778
if action.getAttribute(f'{ns}:priority').isdigit():

0 commit comments

Comments
 (0)