Fix CVE-2026-19873: bound Repeatable counter_name to prevent DoS - #1
Merged
Merged
Conversation
Element::Repeatable::process read its repeat count straight from the query string via counter_name with only a positive-integer check, then passed it to repeat(), which deep-clones the whole child subtree once per iteration with no upper bound. This was reachable via a plain unauthenticated GET request and cost super-linear CPU due to constraint field lookups, with nested Repeatables multiplying the effect further. Add a max_counter attribute on Repeatable (default 100) that clamps the client-supplied count instead of trusting it unbounded, with a counter_clamped flag to signal when clamping occurred. The default is inherited from a new form-level repeatable_max_counter attribute, and max_counter => 0 disables clamping for callers who need it. Direct application calls to repeat() are unaffected. Mirrors the design from FormFu/HTML-FormFu#72. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
plicease
force-pushed
the
graham/cve-2026-19873
branch
from
September 21, 2026 21:16
74ae23b to
1c9b498
Compare
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.
Element::Repeatable::process read its repeat count straight from the query string via counter_name with only a positive-integer check, then passed it to repeat(), which deep-clones the whole child subtree once per iteration with no upper bound. This was reachable via a plain unauthenticated GET request and cost super-linear CPU due to constraint field lookups, with nested Repeatables multiplying the effect further.
Add a max_counter attribute on Repeatable (default 100) that clamps the client-supplied count instead of trusting it unbounded, with a counter_clamped flag to signal when clamping occurred. The default is inherited from a new form-level repeatable_max_counter attribute, and max_counter => 0 disables clamping for callers who need it. Direct application calls to repeat() are unaffected.
Mirrors the design from FormFu/HTML-FormFu#72.