Skip to content

[HIGH] Event filter logic incorrectly rejects events when filters.tags is None #344

@iamgp

Description

@iamgp

Summary

Boolean logic bug in _matches_filters causes events to be incorrectly rejected when filters.tags is None. Expression evaluates incorrectly due to None and anything behavior.

Location

src/phlo/hooks/bus.py lines 196-198

Vulnerable Code

if not (filters.tags and not all(event.tags.get(k) == v for k, v in filters.tags.items())):
    return False

When filters.tags is None, None and anything returns None, and not None is True, causing incorrect rejection.

Recommended Fix

Explicitly check if tags exist before applying filter logic:

if filters.tags is not None and not all(...):
    return False

Severity: P1 - High
Category: Correctness
Audit Reference: AUDIT.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions