Skip to content

Hardening suggestions for jtd-codebuild / revert-3-pixeebot/drip-2024-02-17-pixee-python/subprocess-shell-false #6

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

Conversation

pixeebot[bot]
Copy link

@pixeebot pixeebot bot commented Mar 2, 2024

I've reviewed the recently opened PR (5 - Revert "Use shell=False in subprocess Function Calls") and have identified some area(s) that could benefit from additional hardening measures.

These changes should help prevent potential security vulnerabilities and improve overall code quality.

Thank you for your consideration!

docs | feedback
Powered by: pixeebot

@pixeebot pixeebot bot requested a review from zcarroll4 March 2, 2024 00:57
@@ -66,10 +67,8 @@ def generate(
target_language = target["language"]
target_path = self.get_target_path(target)
safe_mkdir(target_path)
process = subprocess.Popen(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set shell keyword argument to False

@@ -19,10 +20,8 @@ def _compile_typescript(self, tsconfig_path: str) -> subprocess.Popen:
Args:
tsconfig_path: The path to the tsconfig.json file.
"""
return subprocess.run(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set shell keyword argument to False

@@ -14,8 +14,7 @@ def test_example_project_1():
# Run the command
subprocess.check_call(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set shell keyword argument to False

@@ -13,8 +13,7 @@ def test_example_project_2():
# Run the command
subprocess.check_call(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set shell keyword argument to False

@@ -13,8 +13,7 @@ def test_example_project_3():
# Run the command
subprocess.check_call(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set shell keyword argument to False

@@ -13,8 +13,7 @@ def test_example_project_4():
# Run the command
subprocess.check_call(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set shell keyword argument to False

@@ -66,10 +67,8 @@ def generate(
target_language = target["language"]
target_path = self.get_target_path(target)
safe_mkdir(target_path)
process = subprocess.Popen(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaces subprocess.{func} with more secure safe_command library functions.

@@ -19,10 +20,8 @@ def _compile_typescript(self, tsconfig_path: str) -> subprocess.Popen:
Args:
tsconfig_path: The path to the tsconfig.json file.
"""
return subprocess.run(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaces subprocess.{func} with more secure safe_command library functions.

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy