Aias00 opened a new issue, #6800:
URL: https://github.com/apache/shenyu/issues/6800

   - severity: Medium-High
   - files: `AiResponseTransformerPlugin.java:259` 
(`line.matches("^(GET|POST|PUT|DELETE|PATCH|OPTIONS|HEAD)\\s.*\\sHTTP/1.1$")` 
in `extractHeadersFromAiResponse`, iterated per line of every response), 
`AiRequestTransformerPlugin.java:286` (identical pattern, per line per 
request), `AiRequestTransformerPlugin.java:250` 
(`newPath.matches("^/[a-zA-Z0-9/_\\-]*$")` per request)
   - description: `String.matches` compiles a `Pattern` on every invocation 
(JDK does not cache it); called in a `while(readLine)` loop for the 
request-line variants.
   - impact: Regex compilation per line per AI request/response.
   - suggested_fix: Precompile `private static final Pattern 
REQUEST_LINE_PATTERN = Pattern.compile(...)` and use `.matcher(line).matches()`.
   - confidence: High
   
   ---
   _Identified during the 2026-08-02 deep re-scan; full list in 
[`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.md)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to