Skip to content

[ELY-2916] Fix NPE that occurs under heavy request load.#2289

Open
VadimSharomov wants to merge 1 commit intowildfly-security:1.19.xfrom
VadimSharomov:fix-npe-highload
Open

[ELY-2916] Fix NPE that occurs under heavy request load.#2289
VadimSharomov wants to merge 1 commit intowildfly-security:1.19.xfrom
VadimSharomov:fix-npe-highload

Conversation

@VadimSharomov
Copy link
Copy Markdown

@VadimSharomov VadimSharomov commented Jun 14, 2025

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)

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.
@VadimSharomov VadimSharomov changed the title Fix NPE that occurs under heavy request load. [ELY-2916] Fix NPE that occurs under heavy request load. Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant