mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-20 04:09:04 +00:00
The opaque-host percent-escape validation guard reads input.codePointAt(i + 2) after only checking 'input.length() - i < 2', so an input such as 'foo://%4' throws StringIndexOutOfBoundsException instead of reporting a validation error. Fix the bounds guard to require two code points after '%' and check ASCII hex digits rather than ASCII digits, matching the URL spec, where invalid percent-escapes in opaque hosts are validation errors, not failures. Signed-off-by: Sagar Chanchal <Sagarr2112@gmail.com>