mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
add twisted SSH client as secondary server command injection sinks, add proper test cases
This commit is contained in:
@@ -12,6 +12,7 @@ private import experimental.semmle.python.frameworks.Netmiko
|
||||
private import experimental.semmle.python.frameworks.Paramiko
|
||||
private import experimental.semmle.python.frameworks.Pexpect
|
||||
private import experimental.semmle.python.frameworks.Scrapli
|
||||
private import experimental.semmle.python.frameworks.Twisted
|
||||
private import experimental.semmle.python.frameworks.JWT
|
||||
private import experimental.semmle.python.frameworks.Csv
|
||||
private import experimental.semmle.python.libraries.PyJWT
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Provides classes modeling security-relevant aspects of the `twisted` PyPI package.
|
||||
* See https://twistedmatrix.com/.
|
||||
*/
|
||||
|
||||
private import python
|
||||
private import semmle.python.dataflow.new.DataFlow
|
||||
private import semmle.python.dataflow.new.RemoteFlowSources
|
||||
private import semmle.python.dataflow.new.TaintTracking
|
||||
private import semmle.python.Concepts
|
||||
private import semmle.python.ApiGraphs
|
||||
private import semmle.python.frameworks.internal.InstanceTaintStepsHelper
|
||||
import experimental.semmle.python.Concepts
|
||||
|
||||
/**
|
||||
* Provides models for the `twisted` PyPI package.
|
||||
* See https://twistedmatrix.com/.
|
||||
*/
|
||||
private module Twisted {
|
||||
/**
|
||||
* The `newConnection` and `existingConnection` functions of `twisted.conch.endpoints.SSHCommandClientEndpoint` class execute command on ssh target server
|
||||
*/
|
||||
class ParamikoExecCommand extends SecondaryCommandInjection {
|
||||
ParamikoExecCommand() {
|
||||
this =
|
||||
API::moduleImport("twisted")
|
||||
.getMember("conch")
|
||||
.getMember("endpoints")
|
||||
.getMember("SSHCommandClientEndpoint")
|
||||
.getMember(["newConnection", "existingConnection"])
|
||||
.getACall()
|
||||
.getParameter(1, "command")
|
||||
.asSink()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user