Skip to content

PatchWork AutoFix #1575

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 11 commits into
base: main
Choose a base branch
from
Open

PatchWork AutoFix #1575

wants to merge 11 commits into from

Conversation

patched-admin
Copy link
Contributor

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

This pull request from patched fixes 6 issues.


  • File changed: patchwork/common/tools/csvkit_tool.py
    Refactor SQL execution to use parameterized queries Replaced the SQL query string that was using string concatenation with a parameterized query to prevent SQL injection vulnerabilities.
  • File changed: patchwork/common/utils/step_typing.py
    Implement whitelist for secure module loading in validate_step_with_inputs Introduced a whitelist to ensure only trusted modules are allowed to be imported, preventing arbitrary code execution through dynamic module names.
  • File changed: patchwork/app.py
    Add whitelist for allowed modules in importlib.import_module Implemented a whitelist to restrict modules that can be imported using importlib.import_module to prevent execution of untrusted code.
  • File changed: patchwork/common/tools/bash_tool.py
    Fix potential command injection vulnerability in BashTool by disabling shell execution Replaced the use of subprocess.run with shell=True to shell=False in order to prevent command injection vulnerabilities. The command is now split using shlex.split to safely pass arguments to the subprocess call.
  • File changed: patchwork/steps/CallShell/CallShell.py
    Remove shell=True for subprocess.run for security. The subprocess.run call has been modified to use shell=False. The script command is split into a list using shlex.split to ensure it can be safely passed as separate arguments to subprocess.run without invoking a shell.
  • File changed: patchwork/common/utils/dependency.py
    Implement whitelist to secure import_module usage The code now uses a whitelist of allowed module names from the __DEPENDENCY_GROUPS. This prevents loading of arbitrary code through untrusted user input.

@github-actions github-actions bot force-pushed the autofix-fix/gh-agent branch from 8d0cb43 to 979127f Compare April 11, 2025 11:35
Base automatically changed from fix/gh-agent to main April 11, 2025 11:41
@github-actions github-actions bot force-pushed the autofix-fix/gh-agent branch from 979127f to 997a05a Compare April 11, 2025 11:42
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.

3 participants