-
Notifications
You must be signed in to change notification settings - Fork 0
Java: Review changes for https://github.com/github/codeql/pull/3653 #1
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
Java: Review changes for https://github.com/github/codeql/pull/3653 #1
Conversation
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.
There are some gaps between the removed container modeling, and the default container modeling, although I do not think they are critical for Spring support.
@@ -377,34 +377,19 @@ private predicate taintPreservingQualifierToMethod(Method m) { | |||
or | |||
m = any(ProtobufMessageLite p).getAGetterMethod() | |||
or | |||
m instanceof MapMethod and | |||
( | |||
m.getName().regexpMatch("get|entrySet|keySet|values") |
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 noting that keySet
is not covered in ContainerFlow
(unlike the others). However, I believe this is fine for Spring, because a Map
type parameter to a @RequestMapping
method will be unlikely to contain tainted keys, and ContainerFlow
only taints Map
s via the value
not the key
parameter.
(ref: https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-ann-arguments)
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.
keySet
is excluded on purpose as we currently otherwise won't be able to distinguish keys and values in a tainted map. If at some point tainted keys become important to track, then we'll most likely attempt this through a more precise modelling via container-content-as-field-flow.
( | ||
m.getName().regexpMatch("get|toArray|subList|spliterator|set|iterator|listIterator") or | ||
(m.getName().regexpMatch("remove") and not m.getReturnType() instanceof BooleanType) | ||
) |
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.
spliterator
, set
and listIterator
are not covered by ContainerFlow
.
…aflow-tests Small fixups to your PR to my PR
Rewrite XQuery injection to use an additional taint step instead of multiple configurations
No description provided.