JS: Fix TaintedPath

This commit is contained in:
Asger Feldthaus
2020-03-28 10:04:06 +00:00
parent ec19bed1fa
commit 9ee81cb115
2 changed files with 15 additions and 6 deletions

View File

@@ -333,17 +333,26 @@ module TaintTracking {
}
/**
* DEPRECATED. Use the predicate `TaintTracking::persistentStorageStep` instead.
*
* A taint propagating data flow edge through persistent storage.
*/
class PersistentStorageTaintStep extends SharedTaintStep {
deprecated class PersistentStorageTaintStep extends SharedTaintStep {
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
exists(PersistentReadAccess read |
pred = read.getAWrite().getValue() and
succ = read
)
persistentStorageStep(pred, succ)
}
}
/**
* Holds if `pred -> succ` is a taint propagating data flow edge through persistent storage.
*/
predicate persistentStorageStep(DataFlow::Node pred, DataFlow::Node succ) {
exists(PersistentReadAccess read |
pred = read.getAWrite().getValue() and
succ = read
)
}
predicate arrayFunctionTaintStep = ArrayTaintTracking::arrayFunctionTaintStep/3;
/**

View File

@@ -661,7 +661,7 @@ module TaintedPath {
or
promiseTaintStep(src, dst) and srclabel = dstlabel
or
any(TaintTracking::PersistentStorageTaintStep st).step(src, dst) and srclabel = dstlabel
TaintTracking::persistentStorageStep(src, dst) and srclabel = dstlabel
or
exists(DataFlow::PropRead read | read = dst |
src = read.getBase() and