Skip to content

Commit bb75ed0

Browse files
committed
C#: Re-factor ExposureInTransmittedData to use the new API.
1 parent f4ee1a5 commit bb75ed0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

csharp/ql/src/Security Features/CWE-201/ExposureInTransmittedData.ql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ import semmle.code.csharp.security.SensitiveActions
1515
import semmle.code.csharp.security.dataflow.flowsinks.Remote
1616
import semmle.code.csharp.frameworks.system.data.Common
1717
import semmle.code.csharp.frameworks.System
18-
import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
18+
import ExposureInTransmittedData::PathGraph
1919

20-
class TaintTrackingConfiguration extends TaintTracking::Configuration {
21-
TaintTrackingConfiguration() { this = "Exposure through transmitted data" }
22-
23-
override predicate isSource(DataFlow::Node source) {
20+
module ExposureInTransmittedDataConfig implements DataFlow::ConfigSig {
21+
predicate isSource(DataFlow::Node source) {
2422
// `source` may contain a password
2523
source.asExpr() instanceof PasswordExpr
2624
or
@@ -42,10 +40,12 @@ class TaintTrackingConfiguration extends TaintTracking::Configuration {
4240
)
4341
}
4442

45-
override predicate isSink(DataFlow::Node sink) { sink instanceof RemoteFlowSink }
43+
predicate isSink(DataFlow::Node sink) { sink instanceof RemoteFlowSink }
4644
}
4745

48-
from TaintTrackingConfiguration configuration, DataFlow::PathNode source, DataFlow::PathNode sink
49-
where configuration.hasFlowPath(source, sink)
46+
module ExposureInTransmittedData = TaintTracking::Global<ExposureInTransmittedDataConfig>;
47+
48+
from ExposureInTransmittedData::PathNode source, ExposureInTransmittedData::PathNode sink
49+
where ExposureInTransmittedData::flowPath(source, sink)
5050
select sink.getNode(), source, sink, "This data transmitted to the user depends on $@.",
5151
source.getNode(), "sensitive information"

0 commit comments

Comments
 (0)