mirror of
https://github.com/MobSF/Mobile-Security-Framework-MobSF.git
synced 2026-10-11 22:50:09 +00:00
fix(rules): match the literal mode argument in getSharedPreferences (#2638)
The world readable/writable patterns matched any argument list ending with 1 or 2, so decompiled identifiers such as var1, var2 or mode2 were reported as world permissions. Signed-off-by: Eljees <[email protected]> Co-authored-by: Ajin Abraham <[email protected]>
This commit is contained in:
@@ -612,7 +612,7 @@
|
||||
type: RegexOr
|
||||
pattern:
|
||||
- MODE_WORLD_WRITABLE
|
||||
- \.getSharedPreferences\(.{0,50}?2\)
|
||||
- \.getSharedPreferences\([^)]{0,50}?,\s*2\s*\)
|
||||
- 'openFileOutput\(\s*".{1,48}"\s*,\s*2\s*\)'
|
||||
severity: high
|
||||
input_case: exact
|
||||
@@ -627,7 +627,7 @@
|
||||
type: RegexOr
|
||||
pattern:
|
||||
- MODE_WORLD_READABLE
|
||||
- \.getSharedPreferences\(.{0,50}?1\)
|
||||
- \.getSharedPreferences\([^)]{0,50}?,\s*1\s*\)
|
||||
- 'openFileOutput\(\s*".{1,48}"\s*,\s*1\s*\)'
|
||||
severity: high
|
||||
input_case: exact
|
||||
|
||||
Reference in New Issue
Block a user