Java: CWE-552 Query to detect configuration file/source code exposure from unsafe request dispatcher#6251
Java: CWE-552 Query to detect configuration file/source code exposure from unsafe request dispatcher#6251luchua-bc wants to merge 2 commits intogithub:mainfrom
Conversation
|
@luchua-bc Hello, this pr is the same as the one I submitted. #6240 In addition, your title is wrong, it should be |
Oops! I searched security lab issues that are in the open status and the keyword CWE-552 in the codeql repository but didn't find anything including yours before I started to work on my submission. I should have searched pull requests that are in the open status. I just took a look and our queries do have a common piece - yours already covers the I will merge my query with yours after yours is merged into the main branch. |
|
@haby0 I've added a distinct new category of checking |
Directly incorporating user input into HTTP requests dispatched from the Java EE
RequestDispatcherwithout validating the input can allow any web application resource such as configuration files and source code to be disclosed.As stated in the Java API doc, when using a Java EE
RequestDispatcher, requests may be dispatched to any part of the web application bypassing both implicit (no direct access to WEB-INF or META-INF) and explicit (defined by the web application) security constraints. Unsanitized user provided data must not be used to construct the path passed to theRequestDispatcheras it is very likely to create a security vulnerability in the application.This query detects unsafe invocations of
RequestDispatcherwith user controlled input. Please consider to merge the PR. Thanks.