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 #1551

Conversation

patched-admin
Copy link
Contributor

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

This pull request from patched fixes 6 issues.


  • File changed: patchwork/common/tools/csvkit_tool.py
    Refactor to use parameterized queries with sqlite3 to prevent SQL injection Replaced potential SQL injection vulnerabilities by using parameterized queries with the sqlite3 library.
  • File changed: patchwork/common/utils/step_typing.py
    Add whitelist check for importlib.import_module usage The code now includes a whitelist of allowed modules for dynamic imports using importlib.import_module to prevent loading of arbitrary code based on untrusted user input.
  • File changed: patchwork/app.py
    Implement module path whitelist to secure importlib.import_module usage Added a whitelist to restrict module paths that can be passed to importlib.import_module to mitigate risk of loading arbitrary, untrusted code. This ensures that only trusted modules are loaded.
  • File changed: patchwork/common/tools/bash_tool.py
    Refactor subprocess.run to eliminate shell injection vulnerability Replaced the use of subprocess.run with shell=True to a safer alternative using shell=False while ensuring the command is executed using a list format for compatibility with shell=False.
  • File changed: patchwork/steps/CallShell/CallShell.py
    Remove shell=True to prevent shell injection vulnerability Updated the subprocess.run method to use shell=False and split the script into a parts list using shlex.split for safer command execution.
  • File changed: patchwork/common/utils/dependency.py
    Add input validation for importlib.import_module() to prevent arbitrary code execution Implemented a whitelist approach where only modules specified within a predefined list are allowed to be imported using importlib.import_module().

@CTY-git CTY-git closed this Mar 25, 2025
@CTY-git CTY-git deleted the autofix-feature/add-plain-logging branch March 25, 2025 01:49
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