-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Python: New command execution sinks #15715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
3d7db0e
add panas code execution sinks, add proper tests
am0o0 076faa3
add pyTorch :) code execution sinks, add proper tests
am0o0 d234a53
update Fabric models, add new sink to Fabric, add proper test cases
am0o0 70282f9
convert paramiko query to SecondaryServerCmdInjection query, Add inli…
am0o0 385c3ba
continue to convert paramiko query to a more general query,
am0o0 95c9a3f
add ssh client libraries, add SecondaryServerCmdInjectionCustomizations
am0o0 3e6b4a1
finalize Secondary server command injection queries and tests.
am0o0 ab21990
add jsonpickle and pexpect libs in case of unsafe decoding and second…
am0o0 7dd1389
add twisted SSH client as secondary server command injection sinks, a…
am0o0 4321c5c
update Twisted document link
am0o0 a636c47
minor test cases change: remove unused dict
am0o0 b20b733
better structure for pandas DataFrame, it is now much better readable…
am0o0 cffdc5b
add panas code execution sinks, add proper tests
am0o0 2708e57
add pyTorch :) code execution sinks, add proper tests
am0o0 6520e2f
update Fabric models, add new sink to Fabric, add proper test cases
am0o0 5fea71e
convert paramiko query to SecondaryServerCmdInjection query, Add inli…
am0o0 4df73f9
continue to convert paramiko query to a more general query,
am0o0 ead2474
add ssh client libraries, add SecondaryServerCmdInjectionCustomizations
am0o0 7e93102
finalize Secondary server command injection queries and tests.
am0o0 0a765cc
add jsonpickle and pexpect libs in case of unsafe decoding and second…
am0o0 c4a38d0
add twisted SSH client as secondary server command injection sinks, a…
am0o0 6b9cc1a
update Twisted document link
am0o0 8b93e81
minor test cases change: remove unused dict
am0o0 4a2ab49
better structure for pandas DataFrame, it is now much better readable…
am0o0 9b4ea88
Merge branch 'am0o0-python-codeExec' of https://github.com/amammad/co…
am0o0 0043d93
Merge branch 'github:main' into am0o0-python-codeExec
am0o0 3a52cd1
Merge branch 'am0o0-python-codeExec' of https://github.com/amammad/co…
am0o0 f93d4a0
fix Fabric query library
am0o0 0e80e86
fix actions reviews
am0o0 9435a62
revert vscode settings.json file
am0o0 a87d27b
revert vscode settings.json file
am0o0 90da071
fix tests, chore on Find.ql
am0o0 fb3d34c
format Torch.qll
am0o0 37d3318
revert classRef deletion, fix secondaryserverCmdInjection expected te…
am0o0 c7adb32
simply replace duplicate class references with `classRef()` in Fabric…
am0o0 fcd2bd6
fabic.qll: remove test predicate and apply review changes
am0o0 b1242e4
Pandas.qll: remove unnecessary exists, fix class naming
am0o0 8c3994b
Paramiko.qll: improve docs
am0o0 66cba89
Torch.qll: use better alternative instead of exists
am0o0 5299c4a
fix the qhelp of secondary server cmd injectino
am0o0 1714866
Ssh2.qll: fix a typo
am0o0 fd9e6f4
fix the docs of secondary server cmd injection
am0o0 52a8091
SecondaryCommandInjection to RemoteCommandExecution, change RemoteCo…
am0o0 b9edcb7
rename secondary to remote :), complete the previous commit changes
am0o0 1f11246
update id of the query file
am0o0 8a7fdfa
fix conflict
am0o0 cb39ae7
revert .vscode/settings.json
am0o0 1f99559
Revert "update id of the query file"
am0o0 ccb923a
fix formatting
am0o0 eb1999f
revert .vscode/settings.json :((
am0o0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Provides classes modeling security-relevant aspects of the `jsonpickle` PyPI package. | ||
* See https://pypi.org/project/jsonpickle/. | ||
*/ | ||
|
||
private import python | ||
private import semmle.python.dataflow.new.RemoteFlowSources | ||
private import semmle.python.Concepts | ||
private import semmle.python.ApiGraphs | ||
|
||
/** | ||
* Provides models for the `jsonpickle` PyPI package. | ||
* See https://pypi.org/project/jsonpickle/. | ||
*/ | ||
private module Jsonpickle { | ||
/** | ||
* A Call to `jsonpickle.decode`. | ||
* See https://jsonpickle.readthedocs.io/en/latest/api.html#jsonpickle.decode | ||
*/ | ||
private class JsonpickleDecode extends Decoding::Range, API::CallNode { | ||
JsonpickleDecode() { this = API::moduleImport("jsonpickle").getMember("decode").getACall() } | ||
|
||
override predicate mayExecuteInput() { any() } | ||
|
||
override DataFlow::Node getAnInput() { result = this.getParameter(0, "string").asSink() } | ||
|
||
override DataFlow::Node getOutput() { result = this } | ||
|
||
override string getFormat() { result = "pickle" } | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* 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.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"` | ||
* which runs `CMD` on the local system. | ||
* 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() } | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.