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

Closed

Conversation

patched-admin
Copy link
Contributor

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

This pull request from patched fixes 6 issues.


  • File changed: patchwork/common/tools/csvkit_tool.py
    Use parameterized queries to prevent SQL injection. Modified the code to use parameterized queries instead of formatted SQL queries to prevent SQL injection vulnerabilities.
  • File changed: patchwork/common/utils/step_typing.py
    Implement whitelist for module imports in validate_step_with_inputs. Introduced a whitelist for trusted module paths that can be dynamically imported. This prevents loading arbitrary code by restricting imports to known and trusted modules only.
  • File changed: patchwork/app.py
    Restrict importlib.import_module to a whitelist of trusted modules Replaced dynamic use of importlib.import_module with a whitelist of allowed modules to prevent loading arbitrary code from untrusted sources.
  • File changed: patchwork/common/tools/bash_tool.py
    Fix subprocess shell=True vulnerability by using shell=False. Changed the subprocess call to use 'shell=False' and split the command string into a list of arguments.
  • File changed: patchwork/steps/CallShell/CallShell.py
    Fix 'subprocess.run' to use 'shell=False' to prevent shell injection vulnerability Modified the subprocess.run call to use shell=False and utilized shlex.split() to parse the script command into a list of arguments, reducing the risk of shell injection attacks.
  • File changed: patchwork/common/utils/dependency.py
    Implement whitelisting for dynamic module import. The code has been modified to use a whitelist of allowed modules, preventing the importation of arbitrary modules via importlib.import_module().

Base automatically changed from fix-gemini-new-model-token-counting to main March 20, 2025 13:50
@CTY-git CTY-git closed this Mar 25, 2025
@CTY-git CTY-git deleted the autofix-fix-gemini-new-model-token-counting 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