Skip to content
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

Possible OS command injection in code #442

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

openrefactory
Copy link

@openrefactory openrefactory commented Jan 14, 2023

In file: api_hypervisors.py, there is a method that is vulnerable to attacks which can execute arbitrary operating system(OS) commands. Here is the flow in the code that leads to the possible OS Command Injection.

The taint starts from HypervisorsView.py file, line 84. Here variable port is assigned a tainted value from an external source.

port = request.form.get("port", default="2022", type=str)

In that same file (HypervisorsView.py), line 129, the tainted information is passed through a method call via port to the formal parameter port of the method.

Then in api_hypervisors.py file, line 103, the tainted information is passed through a method call via port to the formal parameter port of the method. Similarly the information passes in line 172 of the same file.

Finally, in line 306, the tainted information is passed through a method invocation and is used in a sink.

The data should be sanitized to remove the problem. No fix was given.

@openrefactory
Copy link
Author

There are two other places where the same tainted data flows. In total there are three places in code where port is being assigned from request.form and used in a taint sink subprocess.check_output.

All of them are marked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant