mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Java: Add a global extension point for taint steps.
This commit is contained in:
@@ -40,12 +40,26 @@ predicate localAdditionalTaintStep(DataFlow::Node src, DataFlow::Node sink) {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* A `DataFlow::Node` that is the origin of a taint step.
|
||||
*
|
||||
* Extend this class to add additional taint steps that should apply to all
|
||||
* taint configurations.
|
||||
*/
|
||||
abstract class AdditionalTaintStepNode extends DataFlow::Node {
|
||||
/**
|
||||
* Gets a `DataFlow::Node` that this node can step to in one taint step.
|
||||
*/
|
||||
abstract DataFlow::Node step();
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the additional step from `src` to `sink` should be included in all
|
||||
* global taint flow configurations.
|
||||
*/
|
||||
predicate defaultAdditionalTaintStep(DataFlow::Node src, DataFlow::Node sink) {
|
||||
localAdditionalTaintStep(src, sink)
|
||||
localAdditionalTaintStep(src, sink) or
|
||||
src.(AdditionalTaintStepNode).step() = sink
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user