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
filters: index generic tag criteria instead of scanning every criterion per tag #1256
From the 2026-11-01 scan: F-026 (low, denial of service, CWE-407), src/utils/event.ts. Reachability was not established by the scan.
Current code (main 49f51378): generic-tag matching is event.tags.some(tag => criteria.some(criterion => isMatchingGenericTagCriterion(key, criterion)(tag))). Every event tag is compared against every criterion, so cost is |tags| × |criteria| predicate calls per filter — and both sides are attacker-sized: the event comes from the wire, the criteria come from a subscription the attacker opened. Several subscriptions per connection multiply it, all on the worker's event loop.
Fix shape
Compile exact-match criteria into a map keyed by tag name with value sets; walk event tags once and look up membership.
Handle prefix criteria separately, with a bounded comparison count.
Enforce an aggregate matching budget per connection's subscriptions.
Acceptance
A test asserts predicate calls grow with |tags| + |criteria|, not with their product.
A filter with 10k criteria rejects a non-matching event in bounded time.
Activity