-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Java : add request forgery query #3454
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
Conversation
I just noticed #3452 tackles a similar issue. I will give a brief of how my PR differs from the latter.
|
Can you please open a corresponding securitylab issue for tracking? |
I have added a few stubs which I had missed earlier and rebased this to the latest master. This is now ready to be reviewed and merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have mentioned earlier, I was added as a reviewer automatically by the CODEOWNERS
file. However this PR doesn't need a review from the docs team because most of the changes are to the experimental
directory. We've since updated the CODEOWNERS
file to reflect this.
@aschackmull I have rebased to the latest main. This is now ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Apologies for slowness on our part; I'm taking over reviewing and hope the process will be much quicker from here. Quite a few comments but nothing too time-consuming I hope.
java/ql/src/experimental/CWE-918/RequestForgeryCustomizations.qll
Outdated
Show resolved
Hide resolved
java/ql/src/experimental/CWE-918/RequestForgeryCustomizations.qll
Outdated
Show resolved
Hide resolved
java/ql/src/experimental/CWE-918/RequestForgeryCustomizations.qll
Outdated
Show resolved
Hide resolved
java/ql/src/semmle/code/java/frameworks/spring/SpringRestTemplate.qll
Outdated
Show resolved
Hide resolved
java/ql/test/experimental/query-tests/security/CWE-918/RequestForgery.java
Outdated
Show resolved
Hide resolved
...imental/stubs/springframework-5.2.6/org/springframework/core/ParameterizedTypeReference.java
Outdated
Show resolved
Hide resolved
@smowton Sorry for the delay in addressing the review. I was on a long vacation. I have made the changes and merged the latest master into the branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor comments, checking the evaluation status for this one
java/ql/src/semmle/code/java/frameworks/spring/SpringWebClient.qll
Outdated
Show resolved
Hide resolved
Once your subsidiary PR is merged please rebase onto |
Looks like eval was done long ago, will flag this to codeql-java owners for review |
Could we get this rebased on main? The changes from #4600 still show up here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed some public defns with missing doc comments
result = this.getArgument(1) | ||
} | ||
|
||
Expr protocolArg() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing doc comment
numArgs = this.getNumArgument() | ||
} | ||
|
||
Argument getUriArg() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing doc comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have more comments, but let's start with this.
java/ql/src/semmle/code/java/frameworks/spring/SpringWebClient.qll
Outdated
Show resolved
Hide resolved
java/ql/src/experimental/CWE-918/RequestForgeryCustomizations.qll
Outdated
Show resolved
Hide resolved
java/ql/src/experimental/CWE-918/RequestForgeryCustomizations.qll
Outdated
Show resolved
Hide resolved
The qldoc generally needs a lot of updates to bring it in line with https://github.com/github/codeql/blob/main/docs/qldoc-style-guide.md. Note in particular:
|
@aschackmull I have pushed a few changes. Do I fix them now? |
I've written a bunch of additional suggested changes in a PR against this PR. Please merge https://github.com/porcupineyhairs/ql/pull/2 into this PR. |
Co-authored-by: Chris Smowton <smowton@github.com>
Java: Review fixes.
@aschackmull Merged! |
Is it intended that the files of this query are directly in the (Sorry if this has been mentioned in one of the review comments; I only went over the pull request comments, but did not find anything regarding this) |
They don't appear to be? What file are you referring to? |
Doh right, I thought you meant files directly within the |
This query adds support for detecting SSRF in Java.