mirror of
https://github.com/github/codeql.git
synced 2026-02-23 10:23:41 +01:00
continue to convert paramiko query to a more general query,
the proxy command is not a secondary command execution so we can add proxy command to SystemCommandExecution::Range, update QLDocs, add a proper Paramiko test case fix a typo
This commit is contained in:
@@ -46,6 +46,7 @@ private import semmle.python.frameworks.MySQLdb
|
||||
private import semmle.python.frameworks.Numpy
|
||||
private import semmle.python.frameworks.Oracledb
|
||||
private import semmle.python.frameworks.Pandas
|
||||
private import semmle.python.frameworks.Paramiko
|
||||
private import semmle.python.frameworks.Peewee
|
||||
private import semmle.python.frameworks.Phoenixdb
|
||||
private import semmle.python.frameworks.Psycopg
|
||||
|
||||
35
python/ql/lib/semmle/python/frameworks/Paramiko.qll
Normal file
35
python/ql/lib/semmle/python/frameworks/Paramiko.qll
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Provides classes modeling security-relevant aspects of the `paramiko` PyPI package.
|
||||
* See https://pypi.org/project/paramiko/.
|
||||
*/
|
||||
|
||||
private import python
|
||||
private import semmle.python.dataflow.new.DataFlow
|
||||
private import semmle.python.dataflow.new.RemoteFlowSources
|
||||
private import semmle.python.Concepts
|
||||
private import semmle.python.ApiGraphs
|
||||
|
||||
/**
|
||||
* Provides models for the `paramiko` PyPI package.
|
||||
* See https://pypi.org/project/paramiko/.
|
||||
*/
|
||||
private module Paramiko {
|
||||
/*
|
||||
* The first argument of `paramiko.ProxyCommand`.
|
||||
*
|
||||
* the `paramiko.ProxyCommand` is equivalent of `ssh -o ProxyCommand="CMD"`
|
||||
* and it run CMD on current system that running the ssh command
|
||||
*
|
||||
* See https://paramiko.pydata.org/docs/reference/api/paramiko.eval.html
|
||||
*/
|
||||
|
||||
class ParamikoProxyCommand extends SystemCommandExecution::Range, API::CallNode {
|
||||
ParamikoProxyCommand() {
|
||||
this = API::moduleImport("paramiko").getMember("ProxyCommand").getACall()
|
||||
}
|
||||
|
||||
override DataFlow::Node getCommand() { result = this.getParameter(0, "command_line").asSink() }
|
||||
|
||||
override predicate isShellInterpreted(DataFlow::Node arg) { none() }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user