Java: Promote MVEL injection query from experimental - #6001
Conversation
|
|
aschackmull
left a comment
There was a problem hiding this comment.
I'd like some reshuffling of the content of the two files MvelInjectionQuery.qll and MvelInjectionSinkModels.qll. Only the configuration should go in MvelInjectionQuery.qll whereas the rest of it should go in a file called MvelInjection.qll, which can then both expose the extension points and be generally importable without leaking the configuration.
The qhelp also needs doc review.
I was following the pattern applied to JEXL Injection in all my open PRs:
Should that be changed everywhere to There are also some queries that use a secondary data flow configuration (e.g. |
|
There is some potential merit in keeping the sink models separate such that |
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
aschackmull
left a comment
There was a problem hiding this comment.
LGTM, but needs docs review of the qhelp as this wasn't done when it was originally merged to experimental.
Minor tweaks
mchammer01
left a comment
There was a problem hiding this comment.
@atorralba - this is looking good to me ✨
I made a few minor tweaks to the qhelp file and noticed powerfull on line 23. Not sure whether this is a typo or a genuine context name, so left it as is for now.
Hope this helps!
|
|
Thank you for the review! It was a typo indeed. I removed the word altogether since it wasn't too relevant, and added a "GOOD" example to the sample Java code. |
artem-smotrakov
left a comment
There was a problem hiding this comment.
I am glad to see the query is going to be added to the main query pack!
PR to promote the MVEL Injection query created in #3329
Changes
MvelInjectionLib.qllfile was renamed toMvelInjection.qlland refactored to use the CSV sink model.InlineExpectationsTest.Evaluation
With the addition of the JsonParser taint step introduced in the promotion of the OGNL injection query, this query now detects CVE-2020-13942 (Remote Code Execution in Apache Unomi). This vulnerability was fixed with a filter that implements a deny-list of methods that can be called from MVEL, so the query will still report the issue even though Unomi is no longer vulnerable. Nonetheless, I tried adding that filter as a sanitizer and the query then correctly reports no issues, but it's such a specific sanitizer that I considered it wasn't worth to add it.