@@ -28,17 +28,15 @@ import cpp
2828import semmle.code.cpp.ir.dataflow.TaintTracking
2929import semmle.code.cpp.models.interfaces.FlowSource
3030import semmle.code.cpp.security.OutputWrite
31- import DataFlow :: PathGraph
31+ import PotentiallyExposedSystemData :: PathGraph
3232import SystemData
3333
34- class PotentiallyExposedSystemDataConfiguration extends TaintTracking:: Configuration {
35- PotentiallyExposedSystemDataConfiguration ( ) { this = "PotentiallyExposedSystemDataConfiguration" }
36-
37- override predicate isSource ( DataFlow:: Node source ) {
34+ module PotentiallyExposedSystemDataConfiguration implements DataFlow:: ConfigSig {
35+ predicate isSource ( DataFlow:: Node source ) {
3836 source = any ( SystemData sd | sd .isSensitive ( ) ) .getAnExpr ( )
3937 }
4038
41- override predicate isSink ( DataFlow:: Node sink ) {
39+ predicate isSink ( DataFlow:: Node sink ) {
4240 exists ( OutputWrite ow , Expr child | child = ow .getASource ( ) .getAChild * ( ) |
4341 // Most sinks receive a pointer as an argument (for example `printf`),
4442 // and we use an indirect sink for those.
@@ -53,9 +51,10 @@ class PotentiallyExposedSystemDataConfiguration extends TaintTracking::Configura
5351 }
5452}
5553
56- from
57- PotentiallyExposedSystemDataConfiguration config , DataFlow:: PathNode source ,
58- DataFlow:: PathNode sink
59- where config .hasFlowPath ( source , sink )
54+ module PotentiallyExposedSystemData =
55+ TaintTracking:: Make< PotentiallyExposedSystemDataConfiguration > ;
56+
57+ from PotentiallyExposedSystemData:: PathNode source , PotentiallyExposedSystemData:: PathNode sink
58+ where PotentiallyExposedSystemData:: hasFlowPath ( source , sink )
6059select sink , source , sink , "This operation potentially exposes sensitive system data from $@." ,
6160 source , source .getNode ( ) .toString ( )
0 commit comments