Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[Java] CWE-117: CodeQL query to detect Log Injection #144
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CVE ID(s)
List the CVE ID(s) associated with this vulnerability. GitHub will automatically link CVE IDs to the GitHub Advisory Database.
Report
Log Injection query is available in c# query, javascript (experimental) query but it is not available in java query.
I created a query to detect a log injection vulnerability in java code.
Link to the PR: PR github/codeql#3882
Result(s)
The query was able to detect a potential Log Forging (now fixed) in the
generator-jhipsterproject.This is the PR fixing the potential Log Forging: prevent potential log forging, and here the fixed code https://github.com/jhipster/generator-jhipster/pull/11708/files.
To test the query, I used the vulnerable version of that file. I created a project using
jhipster(Creating an application), and then I run the query on the project already created; the query was able to detect the vulnerability mentioned in the PR (once I created the project, before generating the database, I replaced the fixed code, with its previous version).There is also a CVE (another project): CVE-2020-4072: Log Forging in generator-jhipster-kotlin, that mentions the equivalent
javafile of thegenerator-jhipterproject: commit: prevent log forging when doing password reset init request.