mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
JS: ReactPropStep
This commit is contained in:
@@ -403,22 +403,16 @@ module TaintTracking {
|
||||
* taint to flow from `v` to any read of `c2.props.p`, where `c2`
|
||||
* also is an instance of `C`.
|
||||
*/
|
||||
private class ReactComponentPropsTaintStep extends AdditionalTaintStep {
|
||||
DataFlow::Node source;
|
||||
|
||||
ReactComponentPropsTaintStep() {
|
||||
private class ReactComponentPropsTaintStep extends SharedTaintStep {
|
||||
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
exists(ReactComponent c, string name, DataFlow::PropRead prn |
|
||||
prn = c.getAPropRead(name) or
|
||||
prn = c.getAPreviousPropsSource().getAPropertyRead(name)
|
||||
|
|
||||
source = c.getACandidatePropsValue(name) and
|
||||
this = prn
|
||||
pred = c.getACandidatePropsValue(name) and
|
||||
succ = prn
|
||||
)
|
||||
}
|
||||
|
||||
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
pred = source and succ = this
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user