Add AdditionalTaintStep

This commit is contained in:
Tony Torralba
2022-11-15 16:14:22 +01:00
parent 4b9b35d1c2
commit 8ca004fde1
2 changed files with 16 additions and 0 deletions

View File

@@ -1,6 +1,20 @@
import swift
private import codeql.swift.dataflow.DataFlow
/**
* A unit class for adding additional taint steps.
*
* Extend this class to add additional taint steps that should apply to all
* taint configurations.
*/
class AdditionalTaintStep extends Unit {
/**
* Holds if the step from `node1` to `node2` should be considered a taint
* step for all configurations.
*/
abstract predicate step(DataFlow::Node node1, DataFlow::Node node2);
}
/**
* A `Content` that should be implicitly regarded as tainted whenever an object with such `Content`
* is itself tainted.

View File

@@ -64,6 +64,8 @@ private module Cached {
or
// flow through a flow summary (extension of `SummaryModelCsv`)
FlowSummaryImpl::Private::Steps::summaryLocalStep(nodeFrom, nodeTo, false)
or
any(AdditionalTaintStep a).step(nodeFrom, nodeTo)
}
/**