Skip to content

fix(helpers): wrongfully matching when no relevant signature is available #394

Description

@guzmud

Description

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

  1. OS: { e.g. macOS 14, Windows 11, Ubuntu 22.04, etc. }
  2. Version: { e.g. 1.2.3 }
  3. Other environment details:

Reproducible steps

  1. Run an injector producing other signatures than parent_process_name
  2. Correlate against a collector relying solely on parent_process_name
  3. 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

  1. added
    bug
    on Nov 30, 2026
  2. added
    needs triage
    on Nov 30, 2026
  3. removed
    needs triage
    on Nov 30, 2026
  4. added
    solved
    on Dec 1, 2026
  5. added this to the Bugs backlog milestone on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugsolved

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions