[Backport 2.19] Add query_string nesting depth limit - #22854
[Backport 2.19] Add query_string nesting depth limit#22854finnegancarroll wants to merge 1 commit into
Conversation
…arch-project#22477) Lucene's classic query parser uses mutually recursive grammar productions for parenthesized expressions. Deeply nested parentheses in a query_string can cause StackOverflowError. This adds a pre-parse nesting depth check with a new dynamic cluster setting search.query.max_query_nesting_depth (default 200). Queries exceeding the limit are rejected with a ParseException. Signed-off-by: Finn Carroll <carrofin@amazon.com>
PR Reviewer Guide 🔍(Review updated until commit b944fd8)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to b944fd8 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit b944fd8
Suggestions up to commit b944fd8
|
|
Persistent review updated to latest commit b944fd8 |
|
Persistent review updated to latest commit b944fd8 |
|
❌ Gradle check result for b944fd8: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.19 #22854 +/- ##
============================================
+ Coverage 71.92% 72.22% +0.30%
+ Complexity 66009 64527 -1482
============================================
Files 5342 5103 -239
Lines 307392 299869 -7523
Branches 44862 44085 -777
============================================
- Hits 221105 216594 -4511
+ Misses 67823 65164 -2659
+ Partials 18464 18111 -353 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Backport of #22477 to the
2.19branch.