@@ -11,18 +11,18 @@ import semmle.python.dataflow.TaintTracking
1111import semmle.python.security.strings.Untrusted
1212
1313/** Abstract taint sink that is potentially vulnerable to malicious shell commands. */
14- abstract class CommandSink extends TaintSink { }
14+ abstract deprecated class CommandSink extends TaintSink { }
1515
16- private ModuleObject osOrPopenModule ( ) { result .getName ( ) = [ "os" , "popen2" ] }
16+ deprecated private ModuleObject osOrPopenModule ( ) { result .getName ( ) = [ "os" , "popen2" ] }
1717
18- private Object makeOsCall ( ) {
18+ deprecated private Object makeOsCall ( ) {
1919 exists ( string name | result = ModuleObject:: named ( "subprocess" ) .attr ( name ) |
2020 name = [ "Popen" , "call" , "check_call" , "check_output" , "run" ]
2121 )
2222}
2323
2424/**Special case for first element in sequence. */
25- class FirstElementKind extends TaintKind {
25+ deprecated class FirstElementKind extends TaintKind {
2626 FirstElementKind ( ) { this = "sequence[" + any ( ExternalStringKind key ) + "][0]" }
2727
2828 override string repr ( ) { result = "first item in sequence of " + this .getItem ( ) .repr ( ) }
@@ -31,7 +31,7 @@ class FirstElementKind extends TaintKind {
3131 ExternalStringKind getItem ( ) { this = "sequence[" + result + "][0]" }
3232}
3333
34- class FirstElementFlow extends DataFlowExtension:: DataFlowNode {
34+ deprecated class FirstElementFlow extends DataFlowExtension:: DataFlowNode {
3535 FirstElementFlow ( ) { this = any ( SequenceNode s ) .getElement ( 0 ) }
3636
3737 override ControlFlowNode getASuccessorNode ( TaintKind fromkind , TaintKind tokind ) {
@@ -43,7 +43,7 @@ class FirstElementFlow extends DataFlowExtension::DataFlowNode {
4343 * A taint sink that is potentially vulnerable to malicious shell commands.
4444 * The `vuln` in `subprocess.call(shell=vuln)` and similar calls.
4545 */
46- class ShellCommand extends CommandSink {
46+ deprecated class ShellCommand extends CommandSink {
4747 override string toString ( ) { result = "shell command" }
4848
4949 ShellCommand ( ) {
@@ -81,7 +81,7 @@ class ShellCommand extends CommandSink {
8181 * A taint sink that is potentially vulnerable to malicious shell commands.
8282 * The `vuln` in `subprocess.call(vuln, ...)` and similar calls.
8383 */
84- class OsCommandFirstArgument extends CommandSink {
84+ deprecated class OsCommandFirstArgument extends CommandSink {
8585 override string toString ( ) { result = "OS command first argument" }
8686
8787 OsCommandFirstArgument ( ) {
@@ -111,7 +111,7 @@ class OsCommandFirstArgument extends CommandSink {
111111 * A taint sink that is potentially vulnerable to malicious shell commands.
112112 * The `vuln` in `invoke.run(vuln, ...)` and similar calls.
113113 */
114- class InvokeRun extends CommandSink {
114+ deprecated class InvokeRun extends CommandSink {
115115 InvokeRun ( ) {
116116 this = Value:: named ( "invoke.run" ) .( FunctionValue ) .getArgumentForCall ( _, 0 )
117117 or
@@ -127,12 +127,12 @@ class InvokeRun extends CommandSink {
127127 * Internal TaintKind to track the invoke.Context instance passed to functions
128128 * marked with @invoke.task
129129 */
130- private class InvokeContextArg extends TaintKind {
130+ deprecated private class InvokeContextArg extends TaintKind {
131131 InvokeContextArg ( ) { this = "InvokeContextArg" }
132132}
133133
134134/** Internal TaintSource to track the context passed to functions marked with @invoke.task */
135- private class InvokeContextArgSource extends TaintSource {
135+ deprecated private class InvokeContextArgSource extends TaintSource {
136136 InvokeContextArgSource ( ) {
137137 exists ( Function f , Expr decorator |
138138 count ( f .getADecorator ( ) ) = 1 and
@@ -158,7 +158,7 @@ private class InvokeContextArgSource extends TaintSource {
158158 * A taint sink that is potentially vulnerable to malicious shell commands.
159159 * The `vuln` in `invoke.Context().run(vuln, ...)` and similar calls.
160160 */
161- class InvokeContextRun extends CommandSink {
161+ deprecated class InvokeContextRun extends CommandSink {
162162 InvokeContextRun ( ) {
163163 exists ( CallNode call |
164164 any ( InvokeContextArg k ) .taints ( call .getFunction ( ) .( AttrNode ) .getObject ( "run" ) )
@@ -187,7 +187,7 @@ class InvokeContextRun extends CommandSink {
187187 * A taint sink that is potentially vulnerable to malicious shell commands.
188188 * The `vuln` in `fabric.Group().run(vuln, ...)` and similar calls.
189189 */
190- class FabricGroupRun extends CommandSink {
190+ deprecated class FabricGroupRun extends CommandSink {
191191 FabricGroupRun ( ) {
192192 exists ( ClassValue cls |
193193 cls .getASuperType ( ) = Value:: named ( "fabric.Group" ) and
@@ -203,7 +203,7 @@ class FabricGroupRun extends CommandSink {
203203// -------------------------------------------------------------------------- //
204204// Modeling of the 'invoke' package and 'fabric' package (v 1.x)
205205// -------------------------------------------------------------------------- //
206- class FabricV1Commands extends CommandSink {
206+ deprecated class FabricV1Commands extends CommandSink {
207207 FabricV1Commands ( ) {
208208 // since `run` and `sudo` are decorated, we can't use FunctionValue's :(
209209 exists ( CallNode call |
@@ -228,7 +228,7 @@ class FabricV1Commands extends CommandSink {
228228 * An extension that propagates taint from the arguments of `fabric.api.execute(func, arg0, arg1, ...)`
229229 * to the parameters of `func`, since this will call `func(arg0, arg1, ...)`.
230230 */
231- class FabricExecuteExtension extends DataFlowExtension:: DataFlowNode {
231+ deprecated class FabricExecuteExtension extends DataFlowExtension:: DataFlowNode {
232232 CallNode call ;
233233
234234 FabricExecuteExtension ( ) {
0 commit comments