Introduced protections against user-controlled internal request forwarding #15
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.
This change hardens all
ServletRequest#getRequestDispatcher(String)
calls against attack.There is a built-in HTTP method for sending clients to another resource: the client-side redirect. However, the
getRequestDispatcher(String)
method is unique in that performs a forward which occurs totally within the server-side.There is some security that usually comes within redirecting users back through the "front door". For instance, attackers could never directly request sensitive resources like
/WEB-INF/web.xml
. However, this isn't true for request dispatcher forwarding. Therefore, we must take special care that the path being forwarded isn't towards any known sensitive data.Our change introduces an API that offers some validation against forwards that target sensitive data or attempt to access application code.
More reading
🧚🤖 Powered by Pixeebot
Feedback | Community | Docs | Codemod ID: pixee:java/validate-jakarta-forward-path