Skip to content

fix(native): fix false positives in contains_suspicious due to short keyword substring matching#2

Open
ZnDong wants to merge 1 commit into1193776794:mainfrom
ZnDong:fix-Detection-False-alarm
Open

fix(native): fix false positives in contains_suspicious due to short keyword substring matching#2
ZnDong wants to merge 1 commit into1193776794:mainfrom
ZnDong:fix-Detection-False-alarm

Conversation

@ZnDong
Copy link

@ZnDong ZnDong commented Feb 19, 2026

Short keywords like "su", "hide", "ksu" in SUSPICIOUS_KEYWORDS caused false positives
when matched as substrings of normal paths. For example, the BLAST architecture
(introduced in Android 11) produces fd paths like
"/dmabuf:VRI[MainActivity]#1(BLAST Consumer)" where "Consumer" contains "su",
triggering a false detection. Similar false positives occur with /dev/ashmem,
result, resume, override, etc.

Solution:

  • Split keywords into two categories: long/unique (substring match) and short/ambiguous (boundary match)
  • Add find_with_boundary() requiring non-alphanumeric chars around the keyword
  • Move "su", "hide", "ksu" to BOUNDARY_KEYWORDS with boundary-aware matching
  • Apply the same fix to checkMountNamespaceNative/Syscall

…keyword substring matching

Short keywords like "su", "hide", "ksu" in SUSPICIOUS_KEYWORDS caused false positives when matched as substrings of normal paths. For example, the BLAST architecture (introduced in Android 11) produces fd paths like "/dmabuf:VRI[MainActivity]1193776794#1(BLAST Consumer)" where "Consumer" contains "su", triggering a false detection. Similar false positives occur with /dev/ashmem, result, resume, override, etc.

Solution: - Split keywords into two categories: long/unique keywords (simple substring match) and short/ambiguous keywords (word boundary match) - Add find_with_boundary() that requires non-alphanumeric chars or string boundaries around the keyword - Move "su", "hide", "ksu" to BOUNDARY_KEYWORDS with boundary-aware matching - Apply the same fix to checkMountNamespaceNative/Syscall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant