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

PatchWork AutoFix #1483

Closed
wants to merge 15 commits into from
Closed

PatchWork AutoFix #1483

wants to merge 15 commits into from

Conversation

patched-admin
Copy link
Contributor

@patched-admin patched-admin commented Mar 12, 2025

This pull request from patched fixes 6 issues.


  • File changed: patchwork/common/tools/csvkit_tool.py
    Use parameterized queries to prevent SQL injection This change replaces the untrusted input in the SQL query with parameterized queries to prevent SQL injection vulnerabilities by using the ? placeholder.
  • File changed: patchwork/common/utils/step_typing.py
    Restrict importlib.import_module to trusted modules only Restricted dynamic module imports using a whitelist approach to prevent the execution of untrusted code.
  • File changed: patchwork/app.py
    Implement module path whitelisting to prevent arbitrary code execution The code is updated to use a whitelist of allowed module paths. This prevents the importlib.import_module() and importlib.util.spec_from_file_location() functions from loading untrusted code by ensuring only pre-approved modules can be imported.
  • File changed: patchwork/common/tools/bash_tool.py
    Refactor subprocess call to prevent shell injection vulnerability Modified the subprocess.run call to set shell=False and split the command string into a list of arguments. This prevents shell injection vulnerabilities by ensuring the command execution does not rely on the shell environment.
  • File changed: patchwork/steps/CallShell/CallShell.py
    Remove use of 'shell=True' for subprocess.run to improve security The subprocess.run call has been modified to use 'shell=False'. The command to be executed is passed as a list instead of a string to avoid shell injection vulnerabilities.
  • File changed: patchwork/common/utils/dependency.py
    Add whitelist to restrict modules that can be imported dynamically The code was updated to use a whitelist of allowed module names for dynamic importation, preventing arbitrary code execution through untrusted user input.

@github-actions github-actions bot force-pushed the autofix-support-vertexai-models branch from c0e88a3 to 2e65d25 Compare March 12, 2025 06:05
@github-actions github-actions bot force-pushed the autofix-support-vertexai-models branch from 2e65d25 to 3c46300 Compare March 13, 2025 01:27
@github-actions github-actions bot force-pushed the autofix-support-vertexai-models branch from 3c46300 to aadfdc0 Compare March 13, 2025 02:02
@github-actions github-actions bot force-pushed the autofix-support-vertexai-models branch from aadfdc0 to ff97f9f Compare March 13, 2025 02:08
@github-actions github-actions bot force-pushed the autofix-support-vertexai-models branch from ff97f9f to a7c4686 Compare March 13, 2025 07:31
@github-actions github-actions bot force-pushed the autofix-support-vertexai-models branch from a7c4686 to 908ff0c Compare March 13, 2025 08:33
@github-actions github-actions bot force-pushed the autofix-support-vertexai-models branch from 908ff0c to f3b0b46 Compare March 13, 2025 08:44
@github-actions github-actions bot force-pushed the autofix-support-vertexai-models branch from f3b0b46 to 8d8e298 Compare March 13, 2025 08:49
Base automatically changed from support-vertexai-models to main March 14, 2025 00:56
@CTY-git CTY-git closed this Mar 25, 2025
@CTY-git CTY-git deleted the autofix-support-vertexai-models branch March 25, 2025 01:51
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.

2 participants