feat(filters): report custom-filter outcome reason for inbound filters - #6301
Draft
shellmayr wants to merge 3 commits into
Draft
feat(filters): report custom-filter outcome reason for inbound filters#6301shellmayr wants to merge 3 commits into
shellmayr wants to merge 3 commits into
Conversation
| let event = Event { | ||
| release: Annotated::new(LenientString("1.0".to_owned())), | ||
| ..Default::default() | ||
| }; |
There was a problem hiding this comment.
RuleCondition evaluation in generic/custom filters lacks recursion depth bound
RuleCondition::matches recurses through nested And, Or, Not, Any, and All variants without a depth limit. When a project config contains a deeply nested custom or generic filter condition, evaluating it against an event via should_filter can trigger a stack-overflow abort.
Evidence
- relay-filter/src/generic.rs line ~55:
should_filteriterates over generic/custom filter configs and callsmatches(item, filter_config.condition). - relay-filter/src/generic.rs line ~31:
matchesdelegates toRuleCondition::matches, entering the recursive sink. - relay-protocol/src/condition.rs lines ~790-802:
RuleCondition::matchesdispatches toAndCondition::matches,OrCondition::matches,NotCondition::matches,AnyCondition::matches, andAllCondition::matcheswith no depth guard or visited-set. - The
RuleConditiontrees are deserialized from upstream project-configuration JSON (including new custom filters prefixed withcif-); Relay enforces a 20 MB total response size cap but no nesting-depth validation before evaluation. - No sibling depth-bounded equivalent exists for this evaluation path.
Identified by Warden · wrdn-dos-review · 48Z-6E5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
custom-filterreason in outcomes for the new inbound filters v2Contributes to TET-2842