Skip to content

Commit 90f202a

Browse files
TomasHofmanfl4via
authored andcommitted
[UNDERTOW-2334] CVE-2024-6162 AJP Parser: Do not share the decodeBuffer StringBuilder instance between requests
Signed-off-by: Flavia Rainone <frainone@redhat.com>
1 parent 5ed2b4f commit 90f202a

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

+1-4
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)