Skip to content

Commit ef052c3

Browse files
authored
Merge pull request #1609 from fl4via/UNDERTOW-2334
[UNDERTOW-2334] CVE-2024-6162 AJP Parser: Do not share the decodeBuff…
2 parents 62aef6a + 90f202a commit ef052c3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

core/src/main/java/io/undertow/server/protocol/ajp/AjpRequestParser.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ public class AjpRequestParser {
7777
private final boolean slashDecodingFlag;
7878
private final int maxParameters;
7979
private final int maxHeaders;
80-
private StringBuilder decodeBuffer;
8180
private final boolean allowUnescapedCharactersInUrl;
8281
private final Pattern allowedRequestAttributesPattern;
8382

@@ -509,9 +508,7 @@ public void parse(final ByteBuffer buf, final AjpRequestParseState state, final
509508
private String decode(String url, final boolean containsUrlCharacters) throws UnsupportedEncodingException {
510509
if (doDecode && containsUrlCharacters) {
511510
try {
512-
if(decodeBuffer == null) {
513-
decodeBuffer = new StringBuilder();
514-
}
511+
final StringBuilder decodeBuffer = new StringBuilder();
515512
return URLUtils.decode(url, this.encoding, slashDecodingFlag, false, decodeBuffer);
516513
} catch (Exception e) {
517514
throw UndertowMessages.MESSAGES.failedToDecodeURL(url, encoding, e);

0 commit comments

Comments
 (0)