SONARJAVA-6443 Narrow S5852 to exponential backtracking and create S8786#5674
Conversation
…smell S8786 (super-linear) S5852 (vulnerability) is narrowed to only report exponential backtracking. New rule S8786 (code-smell) covers the remaining super-linear cases (polynomial, quadratic) that are performance concerns but not vulnerabilities.
Agentic Analysis: Early ResultsAgentic Analysis and Context Augmentation are available on your project. Here are some issues that could have been prevented. Follow the links to learn how to put them into action. 2 issue(s) found across 2 file(s):
Analyzed by SonarQube Agentic Analysis in 7.2 s |
Backreferences disable the Java 9 loop optimization, so QUADRATIC_WHEN_OPTIMIZED and LINEAR_WHEN_OPTIMIZED with backrefs remain exponential and must stay in S5852. S8786 no longer reports LINEAR_WHEN_OPTIMIZED at all (either linear/safe or exponential/S5852).
- Add AbstractRedosCheck to GeneratedCheckListTest blacklist - Update autoscan diff files for S5852, S5998, and create S8786 - Move RegexDatabase3:1265 from S8786 to S5852 expected file (backref prevents Java 9+ optimization, so it stays exponential) - Fix S8786.html formatting issues
nils-werner-sonarsource
left a comment
There was a problem hiding this comment.
One minor style nit on the new file.
nils-werner-sonarsource
left a comment
There was a problem hiding this comment.
One minor style nit on the new file.
nils-werner-sonarsource
left a comment
There was a problem hiding this comment.
I left a nitpick comments. Feel free to ignore.
|
Code Review ✅ Approved 2 resolved / 2 findingsSplits regex backtracking rule S5852 into a vulnerability-focused rule and a new super-linear code smell S8786. The downgrade of exponential backreference cases and the fix for S8786's broken markup recommendations are successfully addressed. ✅ 2 resolved✅ Security: Exponential backref regexes downgraded from S5852 to S8786 on Java 9+
✅ Quality: S8786.html has broken markup in fix recommendations
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |




Summary
AbstractRedosCheckbase class