Possible OS command injection in code #442
Open
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.
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.
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.