Skip to content

PatchWork AutoFix #1620

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

Open
wants to merge 6 commits into
base: patchwork-resolveissue-mainPatchflowsNotRecognized
Choose a base branch
from

Conversation

patched-admin
Copy link
Contributor

@patched-admin patched-admin commented Apr 14, 2025

This pull request from patched fixes 6 issues.


  • File changed: patchwork/common/tools/csvkit_tool.py
    Use parameterized queries to prevent SQL Injection Replaced formatted SQL queries using string concatenation with parameterized queries to prevent SQL Injection vulnerabilities.
  • File changed: patchwork/common/utils/step_typing.py
    Implement module whitelist for importlib.import_module to prevent untrusted code execution A whitelist of approved modules is used to control which modules can be dynamically imported using importlib.import_module. This helps prevent loading arbitrary code from untrusted sources.
  • File changed: patchwork/app.py
    Implement whitelist validation for module imports to prevent execution of untrusted code. Added a whitelist of allowed module names to ensure that only trusted modules can be imported dynamically, reducing the risk of executing arbitrary code.
  • File changed: patchwork/common/tools/bash_tool.py
    Use subprocess.run with shell=False for security Updated subprocess.run to use shell=False and split the command string into a list to prevent shell injection vulnerabilities.
  • File changed: patchwork/steps/CallShell/CallShell.py
    Remove usage of 'shell=True' in subprocess.run for better security The code now uses 'shlex.split' to convert the script string into a list of arguments which obviates the need for 'shell=True'. This change reduces the risk of shell injection vulnerabilities.
  • File changed: patchwork/common/utils/dependency.py
    Implement whitelist for import_module to prevent arbitrary code execution A whitelist has been implemented to restrict importlib.import_module() to only import modules that are predefined in the __DEPENDENCY_GROUPS dictionary, thereby preventing arbitrary code execution.

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