-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Python: New command execution sinks #15715
Conversation
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
…ary command execution, add proper test cases
Hello am0o0 👋 In the meantime, feel free to make changes to the pull request. If you'd like to maximize payout for your this and future submissions, here are a few general guidelines, that we might take into consideration when reviewing a submission.
Please note that these are guidelines, not rules. Since we have a lot of different types of submissions, the guidelines might vary for each submission. Happy hacking! |
… and also we can find much more DataFrame objects
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
…ary command execution, add proper test cases
…dd proper test cases
I think my last question is solved in c7adb32. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your submission. Before we can merge this, there are a few comments that need to be addressed.
Once you've addressed the requested changes, I'll re-run the tests and also kick off a performance evaluation (which is needed because you've made changes to files outside the experimental
subdirectory).
Finally, this would probably have been better as two separate PRs, as the command execution sinks are mostly disjoint from your work on secondary command injection.
...rc/experimental/Security/CWE-074/secondaryCommandInjection/SecondaryServerCmdInjection.qhelp
Outdated
Show resolved
Hide resolved
python/ql/src/experimental/semmle/python/security/SecondaryServerCmdInjection.qll
Outdated
Show resolved
Hide resolved
…mandExecution to module like SystemCommandExecution module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the changes. I think this looks good. 👍
However, there's now a merge conflict on the paramiko.expected
file (which was deleted).
Could you kindly resolve that conflict? Then I can run the final performance tests, and (assuming there are no issues with performance) merge the PR.
This reverts commit 1f11246.
@tausbn I'm not really good at working with Git :) IDK if it is solved or not. |
I think you solved the merge conflict (at least the tests can run now), but I'm not too sure about the revert in the latest commit. Also:
(So many hoops to jump through...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Performance looks good! In it goes. 👍
What is new?
JsonPickle library Code execution sinks
Pytorch library Code execution sinks
Pexpect library Command Execution and Secondary server cmd injection
AsyncSsh library Secondary server cmd injection
Netmiko library Secondary server cmd injection
Scrapli library Secondary server cmd injection
Twisted library Secondary server cmd injection
Ssh2-python library Secondary server cmd injection
pandas library DataFrame Code execution sinks
What has changed?
Upgrade paramiko query to Secondary server command execution query which attackers can execute commands on other than the primary server. it is in the experimental directory.
for the paramiko query, it has added
proxyCommand
as aSystemCommandExecution
because it executes commands on the primary server.Upgraded
Fabric
framework and added proxy_command as aSystemCommandExecution
, I didn't change the sinks of this framework to Secondary server command execution because it is not in an experimental library, otherwise therun
andsudo
functions areSecondaryCommandInjection
andlocal
function isSystemCommandExecution
. I only simplified the framework structure with new higher-level APIs and addedSystemCommandExecution
new sinks.Also, I tried my best to use inline tests everywhere so you can review this PR more easily. :)