-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Relocate Java CWE libraries to importable location #3923
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
A little part of this is similar to my PR #3881 |
Thanks for the update. Seems like your PR covers the |
This looks like a good approach. Could you make the naming of those new library files consistent? Some have a |
I have dropped the |
|
Was just about the ask about the failing It seems that they are not covered by a unit test. |
Both `ResponseSplittingLocal.ql` and `UrlRedirectLocal.ql` referenced the original library location instead of the new location.
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.
The SqlInjection[Lib].qll
file should not be exposed in its entirety. It should be split in two files with the configuration and the queryTaintedBy
predicate kept in a .qll
next to the queries. Furthermore, once the top half of the file becomes importable we should make sure that it starts with import java
as the very first import (and remove the subsequently superfluous import semmle.code.java.Expr
).
Which parts of |
This what I would like to discover through this PR. In the other libraries there are also The end-goal would be to only have extensible elements in these libraries. |
The goal was the |
In that case, consider splitting the file such that the query specific parts are moved to the query and the sink is refactored as an importable abstract class. |
The approach is fine, it just needs individual care and attention for each query, as we don't necessarily want to expose everything, and once we expose something the quality requirements to the QL code goes up. |
(I've only reviewed a few of the files - I have a lot more review comments coming) |
Given that, I will continue and ensure that only the extensible parts remain in the libraries to prevent unnecessary exposure. |
Given the scope of this, perhaps it would be easier to review and merge if we split this up into several PRs - with one PR for each CWE directory? |
Sounds good. I will split it up in a PR per CWE directory. |
Minor convenience thing: Please include "Java: " as a prefix in the PR titles. |
This PR will be split into one PR per CWE directory. |
Multiple Java CWE queries use libraries that define
source
andsink
nodes or other abstract classes of interest.However, customisations cannot extend the CWE queries by defining new
source
orsink
nodes due to the location of these libraries (i.e., their locationCWE-
contains a hyphen and cannot be imported).This PR tracks the effort of relocating these 'extension points' to a location that can be imported by customisations to extend these queries without having to resort to QL code duplication.