fix(932171): backport regex-assembly formalization to lts/v4.25.x#4728
Merged
Conversation
Partial cherry-pick of #4703. That PR's actual json.-prefix fix for ARGS_NAMES is already present on this branch: backporting PR #4672 earlier took the LTS side wholesale for this file and silently dropped the fix for hand-written inline rules (932171, 942361, see d9eda15), which was then independently restored on this branch as part of preparing v4.25.1 - before #4703 re-fixed the same gap on main (where it had regressed separately via an unrelated fork-merge conflict resolution mistake). So the only real delta here is formalizing 932171 into a proper regex-assembly file (previously hand-written inline) and applying the project's standard [\s\x0b] whitespace-class normalization - a consistency/maintainability change, not a functional fix.
This was referenced Jul 19, 2026
theseion
approved these changes
Jul 19, 2026
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.
what
Partial backport related to #4703 ("fix: allow optional json. prefix in rule 932171 ARGS_NAMES pattern"): formalizes rule 932171 into a
regex-assembly/932171.rafile (previously hand-written inline) and applies the project's standard[\s\x0b]whitespace-class normalization.why
This is not a functional fix on this branch — the actual
json.ARGS_NAMES prefix detection that #4703 restores onmainwas already present here. Backporting PR #4672 (4RI-250413) onto this branch earlier took the LTS side wholesale for this file and silently dropped that fix for hand-written inline rules (932171, 942361) — see commitd9eda15e1("fix: restore dropped json. prefix fixes..."), which independently restored it as part of preparing v4.25.1, before #4703 re-fixed the same gap onmain(where it had separately regressed via an unrelated fork-merge conflict resolution).Traced this precisely before backporting anything: confirmed the exact regex on this branch already matches
^(?:json\.)?\(\s*\)\s+\{, and confirmed viagit log -Lthatmain's copy of this rule flip-flopped (added by #4672, reverted by an unrelated ReDoS-fix fork-merge, restored by #4703) while this branch never lost it. So the only real delta worth backporting is the.raformalization and the\s→[\s\x0b]normalization.Also checked rule 942361 (the other rule named in
d9eda15e1) — identical and correct on both branches already, no action needed there.refs
verification
REQUEST-932-APPLICATION-ATTACK-RCEregression suite (918 tests) — all passinglts/v4.25.xbaseline — identical error count (709) and zero new::errorlineslts/v4.25.xtouches exactly one line inrules/REQUEST-932-APPLICATION-ATTACK-RCE.conf(caught and reverted an earlier mistake wheregit checkout --theirson the whole file would have wrongly overwritten 55 unrelated rules'ver:tags and pulled in a rule that doesn't exist on this branch)ai disclosure
mainandlts/v4.25.xto determine this backport's actual scope, formalizing the.rafile, resolving the conflict surgically, drafting this PR descriptiongit log -L(line-history tracking) to precisely trace every change to this rule's regex onmain, confirming which commits added/removed the json. prefix and why; verified the target regex viacrs-toolchain regex compare(read-only) rather thanregex update, after catching that a naivegit checkout --theirson the whole file would have introduced 55 unrelated changes; ran the full rule-family regression suite and diffed linter error counts against baseline