Skip to content

Fix/filter max depth - #26

Merged
chifflier merged 3 commits into
masterfrom
fix/filter-max-depth
Sep 12, 2026
Merged

Fix/filter max depth#26
chifflier merged 3 commits into
masterfrom
fix/filter-max-depth

Conversation

@chifflier

Copy link
Copy Markdown
Member

Add a maximum recursion depth when parsing Filter (potential Denial-of-service)
Parsing a BER object using Filter::from_ber is recursive, and can cause a
stack overflow if parsing crafted data, causing a crash of the application

Since the from_ber function is defined by a Trait and does not allow extra
arguments, we change the following:

  • from_ber now call wrapped functions using a maximum depth
  • from_ber use a default compile-time value of 32

…f-service)

Parsing a BER object using `Filter::from_ber` is recursive, and can cause a
stack overflow if parsing crafted data, causing a crash of the application

Since the `from_ber` function is defined by a Trait and does not allow extra
arguments, we change the following:
- `from_ber` now call wrapped functions using a maximum depth
- `from_ber` use a default compile-time value of 32

Reported-by: Nozomi Networks Labs via Suricata Team
Credit: Nozomi Networks Labs
Credit: Trail of Bits
@chifflier
chifflier merged commit e6ef165 into master Sep 12, 2026
13 of 23 checks passed
@chifflier
chifflier deleted the fix/filter-max-depth branch September 12, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant