mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
C#: Re-factor ExposureInTransmittedData to use the new API.
This commit is contained in:
@@ -15,12 +15,10 @@ import semmle.code.csharp.security.SensitiveActions
|
||||
import semmle.code.csharp.security.dataflow.flowsinks.Remote
|
||||
import semmle.code.csharp.frameworks.system.data.Common
|
||||
import semmle.code.csharp.frameworks.System
|
||||
import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
|
||||
import ExposureInTransmittedData::PathGraph
|
||||
|
||||
class TaintTrackingConfiguration extends TaintTracking::Configuration {
|
||||
TaintTrackingConfiguration() { this = "Exposure through transmitted data" }
|
||||
|
||||
override predicate isSource(DataFlow::Node source) {
|
||||
module ExposureInTransmittedDataConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) {
|
||||
// `source` may contain a password
|
||||
source.asExpr() instanceof PasswordExpr
|
||||
or
|
||||
@@ -42,10 +40,12 @@ class TaintTrackingConfiguration extends TaintTracking::Configuration {
|
||||
)
|
||||
}
|
||||
|
||||
override predicate isSink(DataFlow::Node sink) { sink instanceof RemoteFlowSink }
|
||||
predicate isSink(DataFlow::Node sink) { sink instanceof RemoteFlowSink }
|
||||
}
|
||||
|
||||
from TaintTrackingConfiguration configuration, DataFlow::PathNode source, DataFlow::PathNode sink
|
||||
where configuration.hasFlowPath(source, sink)
|
||||
module ExposureInTransmittedData = TaintTracking::Global<ExposureInTransmittedDataConfig>;
|
||||
|
||||
from ExposureInTransmittedData::PathNode source, ExposureInTransmittedData::PathNode sink
|
||||
where ExposureInTransmittedData::flowPath(source, sink)
|
||||
select sink.getNode(), source, sink, "This data transmitted to the user depends on $@.",
|
||||
source.getNode(), "sensitive information"
|
||||
|
||||
Reference in New Issue
Block a user