[ELY-2916] Fix NPE that occurs under heavy request load.#2289
Open
VadimSharomov wants to merge 1 commit intowildfly-security:1.19.xfrom
Open
[ELY-2916] Fix NPE that occurs under heavy request load.#2289VadimSharomov wants to merge 1 commit intowildfly-security:1.19.xfrom
VadimSharomov wants to merge 1 commit intowildfly-security:1.19.xfrom
Conversation
Logs: 1. NullPointerException: because request.getRequestURI()" is null ... ERROR [io.undertow.request] (default task-839) UT005023: Exception handling request to /app/res.../...: java.lang.NullPointerException: Cannot invoke "java.net.URI.getPath()" because the return value of "org.wildfly.security.http.HttpServerRequest.getRequestURI()" is null ... at org.wildfly.security.elytron-base//org.wildfly.security.http.form.FormAuthenticationMechanism.evaluateRequest(FormAuthenticationMechanism.java:106) 2. NullPointerException: Cannot invoke "java.net.URI.getScheme()" because "requestURI" is null ... ERROR [io.undertow.request] (default task-3) UT005023: Exception handling request to /app/remote/fgt_lang: java.lang.NullPointerException: Cannot invoke "java.net.URI.getScheme()" because "requestURI" is null ... at org.wildfly.security.elytron-base//org.wildfly.security.http.form.FormAuthenticationMechanism.sendLogin(FormAuthenticationMechanism.java:334) p.s. 2nd NPE happened in this line code: String scheme = requestURI.getScheme(), but row number is not the same, which showed in the log, because during debugging it was added few row of comments and debug messages above.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELY-2916
It happened under heavy request load from the Invicti Scanner.
When sending the same request manually, this error cannot be reproduced.
Environment: Amazon Corretto 17, Apache HTTP, WildFly 26.1.3.Final (standalone), deployed on Amazon Linux 2023.
To fix the issue, we modified the source code, rebuilt the wildfly-elytron-http-form-1.19.1.Final.jar library, and replaced it in the WildFly module directory: /modules/system/layers/base/org/wildfly/security/elytron-base/main.
After this change, the NPEs no longer occurred.
This part of the code remains the same in all versions higher than 1.19, but we have not tested it on WildFly versions newer than 26.1.3.Final.
Logs:
1.
ERROR [io.undertow.request] (default task-839) UT005023: Exception handling request to somePath: java.lang.NullPointerException: Cannot invoke "java.net.URI.getPath()" because the return value of "org.wildfly.security.http.HttpServerRequest.getRequestURI()" is null
at org.wildfly.security.elytron-base//org.wildfly.security.http.form.FormAuthenticationMechanism.evaluateRequest(FormAuthenticationMechanism.java:106)
ERROR [io.undertow.request] (default task-3) UT005023: Exception handling request to somePath java.lang.NullPointerException: Cannot invoke "java.net.URI.getScheme()" because "requestURI" is null
at org.wildfly.security.elytron-base//org.wildfly.security.http.form.FormAuthenticationMechanism.sendLogin(FormAuthenticationMechanism.java:334)