Skip to content

Commit

Permalink
[UNDERTOW-2280] CVE-2023-5379 At AjpReadListener, do not close the co…
Browse files Browse the repository at this point in the history
…nnection if read is larger than maxRequestSize

Signed-off-by: Flavia Rainone <[email protected]>
  • Loading branch information
fl4via committed Feb 21, 2024
1 parent 93d1549 commit f8e0796
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package io.undertow.server.protocol.ajp;

import io.undertow.UndertowLogger;
import io.undertow.UndertowMessages;
import io.undertow.UndertowOptions;
import io.undertow.conduits.ConduitListener;
import io.undertow.conduits.EmptyStreamSourceConduit;
Expand Down Expand Up @@ -165,8 +166,9 @@ public void handleEvent(final StreamSourceChannel channel) {
}
if (read > maxRequestSize) {
UndertowLogger.REQUEST_LOGGER.requestHeaderWasTooLarge(connection.getPeerAddress(), maxRequestSize);
safeClose(connection);
return;
//safeClose(connection);
//return;
throw UndertowMessages.MESSAGES.badRequest();
}
} while (!state.isComplete());

Expand Down

0 comments on commit f8e0796

Please sign in to comment.