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

updates to avoid shell injection vulnerability #22 #42

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

Conversation

Just2Deep
Copy link

P.S there are some formatting changes(single quote to double quotes) due to Black Formatter, Hope that is okay

Copy link

cla-bot bot commented Mar 27, 2024

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @Just2Deep on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added.

Copy link

cla-bot bot commented Mar 27, 2024

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @Just2Deep on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added.

@Just2Deep
Copy link
Author

I have read the CLA Document and I hereby sign the CLA.

except:
raise EnvironmentError()
else:
subprocess.run(["source", ".env"], check=True)

Check notice

Code scanning / Bandit

Starting a process with a partial executable path Note

Starting a process with a partial executable path
except:
raise EnvironmentError()
else:
subprocess.run(["source", ".env"], check=True)

Check notice

Code scanning / Bandit

subprocess call - check for execution of untrusted input. Note

subprocess call - check for execution of untrusted input.
def install(packages):
if packages == "pip install fastapi[all]":
subprocess.call("pip install fastapi[all]", shell=True)
packages = packages.split(" ") # passing as list of commands
subprocess.run(packages, check=True)

Check notice

Code scanning / Bandit

subprocess call - check for execution of untrusted input. Note

subprocess call - check for execution of untrusted input.
for package in packages:subprocess.call(package, shell=True)
else:subprocess.call(packages, shell=True)
for package in packages:
subprocess.run(package.split(" "), check=True)

Check notice

Code scanning / Bandit

subprocess call - check for execution of untrusted input. Note

subprocess call - check for execution of untrusted input.
for package in packages:
subprocess.run(package.split(" "), check=True)
else:
subprocess.run(packages.split(" "), check=True)

Check notice

Code scanning / Bandit

subprocess call - check for execution of untrusted input. Note

subprocess call - check for execution of untrusted input.
b = b.split(" ") # split commands into a list
if b[0] == "python":
b[0] = sys.executable # to support execution of script in windows
subprocess.run(b, check=True)

Check notice

Code scanning / Bandit

subprocess call - check for execution of untrusted input. Note

subprocess call - check for execution of untrusted input.
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