mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Refactor the traint-tracking library to follow the dataflow library refactoring
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
* Provides C++-specific definitions for use in the taint tracking library.
|
||||
*/
|
||||
|
||||
private import codeql.dataflow.TaintTrackingParameter
|
||||
private import codeql.dataflow.TaintTracking
|
||||
private import DataFlowImplSpecific
|
||||
|
||||
module CppOldTaintTracking implements TaintTrackingParameter<CppOldDataFlow> {
|
||||
module CppOldTaintTracking implements InputSig<CppOldDataFlow> {
|
||||
import TaintTrackingUtil
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* Provides C++-specific definitions for use in the taint tracking library.
|
||||
*/
|
||||
|
||||
private import codeql.dataflow.TaintTrackingParameter
|
||||
private import codeql.dataflow.TaintTracking
|
||||
private import DataFlowImplSpecific
|
||||
|
||||
module CppTaintTracking implements TaintTrackingParameter<CppDataFlow> {
|
||||
module CppTaintTracking implements InputSig<CppDataFlow> {
|
||||
import TaintTrackingUtil
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* Provides C#-specific definitions for use in the taint tracking library.
|
||||
*/
|
||||
|
||||
private import codeql.dataflow.TaintTrackingParameter
|
||||
private import codeql.dataflow.TaintTracking
|
||||
private import DataFlowImplSpecific
|
||||
|
||||
module CsharpTaintTracking implements TaintTrackingParameter<CsharpDataFlow> {
|
||||
module CsharpTaintTracking implements InputSig<CsharpDataFlow> {
|
||||
import TaintTrackingPrivate
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* Provides Go-specific definitions for use in the taint tracking library.
|
||||
*/
|
||||
|
||||
private import codeql.dataflow.TaintTrackingParameter
|
||||
private import codeql.dataflow.TaintTracking
|
||||
private import DataFlowImplSpecific
|
||||
|
||||
module GoTaintTracking implements TaintTrackingParameter<GoDataFlow> {
|
||||
module GoTaintTracking implements InputSig<GoDataFlow> {
|
||||
import TaintTrackingUtil
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* Provides Java-specific definitions for use in the taint tracking library.
|
||||
*/
|
||||
|
||||
private import codeql.dataflow.TaintTrackingParameter
|
||||
private import codeql.dataflow.TaintTracking
|
||||
private import DataFlowImplSpecific
|
||||
|
||||
module JavaTaintTracking implements TaintTrackingParameter<JavaDataFlow> {
|
||||
module JavaTaintTracking implements InputSig<JavaDataFlow> {
|
||||
import TaintTrackingUtil
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* Provides Python-specific definitions for use in the taint tracking library.
|
||||
*/
|
||||
|
||||
private import codeql.dataflow.TaintTrackingParameter
|
||||
private import codeql.dataflow.TaintTracking
|
||||
private import DataFlowImplSpecific
|
||||
|
||||
module PythonTaintTracking implements TaintTrackingParameter<PythonDataFlow> {
|
||||
module PythonTaintTracking implements InputSig<PythonDataFlow> {
|
||||
import TaintTrackingPrivate
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* Provides Ruby-specific definitions for use in the taint tracking library.
|
||||
*/
|
||||
|
||||
private import codeql.dataflow.TaintTrackingParameter
|
||||
private import codeql.dataflow.TaintTracking
|
||||
private import DataFlowImplSpecific
|
||||
|
||||
module RubyTaintTracking implements TaintTrackingParameter<RubyDataFlow> {
|
||||
module RubyTaintTracking implements InputSig<RubyDataFlow> {
|
||||
import TaintTrackingPrivate
|
||||
}
|
||||
|
||||
@@ -3,19 +3,39 @@
|
||||
* global (inter-procedural) taint-tracking analyses.
|
||||
*/
|
||||
|
||||
private import DataFlow
|
||||
private import DataFlowImpl
|
||||
private import DataFlowParameter
|
||||
import TaintTrackingParameter
|
||||
private import DataFlow as DF
|
||||
private import internal.DataFlowImpl
|
||||
|
||||
/**
|
||||
* Provides language-specific taint-tracking parameters.
|
||||
*/
|
||||
signature module InputSig<DF::InputSig Lang> {
|
||||
/**
|
||||
* Holds if `node` should be a sanitizer in all global taint flow configurations
|
||||
* but not in local taint.
|
||||
*/
|
||||
predicate defaultTaintSanitizer(Lang::Node node);
|
||||
|
||||
/**
|
||||
* Holds if the additional step from `src` to `sink` should be included in all
|
||||
* global taint flow configurations.
|
||||
*/
|
||||
predicate defaultAdditionalTaintStep(Lang::Node src, Lang::Node sink);
|
||||
|
||||
/**
|
||||
* Holds if taint flow configurations should allow implicit reads of `c` at sinks
|
||||
* and inputs to additional taint steps.
|
||||
*/
|
||||
bindingset[node]
|
||||
predicate defaultImplicitTaintRead(Lang::Node node, Lang::ContentSet c);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct the modules for taint-tracking analyses.
|
||||
*/
|
||||
module TaintFlowMake<
|
||||
DataFlowParameter DataFlowLang, TaintTrackingParameter<DataFlowLang> TaintTrackingLang>
|
||||
{
|
||||
module TaintFlowMake<DF::InputSig DataFlowLang, InputSig<DataFlowLang> TaintTrackingLang> {
|
||||
private import TaintTrackingLang
|
||||
private import DataFlowMake<DataFlowLang> as DataFlow
|
||||
private import DF::DataFlowMake<DataFlowLang> as DataFlow
|
||||
private import MakeImpl<DataFlowLang> as DataFlowInternal
|
||||
|
||||
private module AddTaintDefaults<DataFlowInternal::FullStateConfigSig Config> implements
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* Provides the signature for the language-specific parts of the taint-tracking analyses.
|
||||
*/
|
||||
|
||||
import DataFlowParameter
|
||||
|
||||
signature module TaintTrackingParameter<DataFlowParameter Lang> {
|
||||
/**
|
||||
* Holds if `node` should be a sanitizer in all global taint flow configurations
|
||||
* but not in local taint.
|
||||
*/
|
||||
predicate defaultTaintSanitizer(Lang::Node node);
|
||||
|
||||
/**
|
||||
* Holds if the additional step from `src` to `sink` should be included in all
|
||||
* global taint flow configurations.
|
||||
*/
|
||||
predicate defaultAdditionalTaintStep(Lang::Node src, Lang::Node sink);
|
||||
|
||||
/**
|
||||
* Holds if taint flow configurations should allow implicit reads of `c` at sinks
|
||||
* and inputs to additional taint steps.
|
||||
*/
|
||||
bindingset[node]
|
||||
predicate defaultImplicitTaintRead(Lang::Node node, Lang::ContentSet c);
|
||||
}
|
||||
@@ -2,10 +2,10 @@
|
||||
* Provides Swift-specific definitions for use in the taint tracking library.
|
||||
*/
|
||||
|
||||
private import codeql.dataflow.TaintTrackingParameter
|
||||
private import codeql.dataflow.TaintTracking
|
||||
private import DataFlowImplSpecific
|
||||
|
||||
module SwiftTaintTracking implements TaintTrackingParameter<SwiftDataFlow> {
|
||||
module SwiftTaintTracking implements InputSig<SwiftDataFlow> {
|
||||
import TaintTrackingPrivate
|
||||
import TaintTrackingPublic
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user