/** * @name Uncontrolled data used in path expression * @description Accessing paths influenced by users can allow an attacker to access unexpected resources. * @kind path-problem * @problem.severity error * @security-severity 7.5 * @precision high * @id cs/path-injection * @tags security * external/cwe/cwe-022 * external/cwe/cwe-023 * external/cwe/cwe-036 * external/cwe/cwe-073 * external/cwe/cwe-099 */ import csharp import semmle.code.csharp.security.dataflow.TaintedPathQuery::TaintedPath import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink where c.hasFlowPath(source, sink) select sink.getNode(), source, sink, "$@ flows to here and is used in a path.", source.getNode(), "User-provided value"