You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(helpers): wrongfully matching when no relevant signature is available #394
In pyoaev/helpers.py, in the OpenAEVDetectionHelper class, in the _match_alert_elements_original function, if there is no relevant signature post-filtering (line :397), the signatures_number is set at 0 (line :402) and thus match the matching_number set at 0 (line :403) leading to an automatic match when comparing both at line :421.
OpenAEVDetectionHelper implicitly rely on the signatures being checked for relevant signatures before the filtering done inside the helper which is a bad code practice (for multiple reasons).
This issue is not meant to fix this (the helper is being replaced/phased out through the experiments made in the template collector with its more explicit steps regarding the processing), this issue is meant to quickly fail in such a case (such as adding a line after :402 to return False if the signatures_number is 0).
Environment
OS: { e.g. macOS 14, Windows 11, Ubuntu 22.04, etc. }
Version: { e.g. 1.2.3 }
Other environment details:
Reproducible steps
Run an injector producing other signatures than parent_process_name
Correlate against a collector relying solely on parent_process_name
Get a detection and/or prevention match with no relevant alert or details
Expected output
Match fails
Actual output
Match does not fail
Suggested fix
Add at pyoaev/helpers.py:403 something along the line of if signatures_number == 0: return False
Additional information
In the template collector, this is solved by splitting more explicitly the steps of building the signature groups (step 3) and matching them with the data (step 5), with a check done on both inputs (signature groups and alert data) at the beginning of the matching function.
Activity
fix(helpers): fail-fast when no relevant signature is available (#394)
fix(helpers): fail-fast when no relevant signature is available (#394)