-
Notifications
You must be signed in to change notification settings - Fork 253
[Java] CWE-552: Query to detect unsafe request dispatcher usage #495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Your submission is now in status Test run. For information, the evaluation workflow is the following: |
Your submission is now in status Results analysis. For information, the evaluation workflow is the following: |
@luchua-bc Thank you for the submission, we've done an initial analysis of the query results. Overall the results are of good quality. However, we noticed that some results are FP due to the taint flow going into virtual methods like |
Thanks @m-y-mo for reviewing this PR. Could you share URLs of one or a few repositories with FPs mentioned above? This will help me to validate the query after making the changes. |
For example, try running this query on Apache Struts and you should see that the results are going through the |
Hi @m-y-mo, I've added a sanitizer for those virtual method calls as per your suggestion. Now the Please check again and let me know if more changes are required. Thanks, |
Hi @m-y-mo, Have you got a chance to check again? Would you please provide an update? Thanks. |
Your submission is now in status Query review. For information, the evaluation workflow is the following: |
Thanks and sorry for the late reply. I had a look at the results and the problem with |
Thanks @m-y-mo a lot for the prompt update. |
Your submission is now in status Final decision. For information, the evaluation workflow is the following: |
Your submission is now in status Pay. For information, the evaluation workflow is the following: |
Created Hackerone report 1454582 for bounty 362499 : [495] [Java] CWE-552: Query to detect unsafe request dispatcher usage |
Your submission is now in status Closed. For information, the evaluation workflow is the following: |
Thanks @xcorail for the bounty and the quick turn-around. |
Query
Link to pull request with your CodeQL query:
Relevant PR: github/codeql#7286
CVE ID(s)
List the CVE ID(s) associated with this vulnerability. GitHub will automatically link CVE IDs to the GitHub Advisory Database.
Report
Describe the vulnerability. Provide any information you think will help GitHub assess the impact your query has on the open source community.
Directly incorporating user input into HTTP requests dispatched from the Java EE RequestDispatcher without proper validation of 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 the RequestDispatcher as it is very likely to create a security vulnerability in the application.
This query detects unsafe invocations of RequestDispatcher with user controlled input. Important features include:
java.nio.file.Path
packageResult(s)
Provide at least one useful result found by your query, on some revision of a real project.
The text was updated successfully, but these errors were encountered: