Skip to content

Conversation

@patched-admin
Copy link
Contributor

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

This pull request from patched fixes 5 issues.


  • File changed: patchwork/common/utils/step_typing.py
    Implement whitelist for module imports to prevent arbitrary code execution The code now uses a whitelist to ensure that only predefined module imports are allowed in importlib.import_module(), preventing loading of arbitrary code via user input.
  • File changed: patchwork/app.py
    Restrict import_module usage to trusted modules A whitelist of trusted modules is introduced to ensure importlib.import_module only loads predetermined modules, reducing the risk of arbitrary code execution.
  • File changed: patchwork/common/tools/bash_tool.py
    Fix subprocess.run vulnerability by setting shell=False Modified the subprocess.run call to use shell=False and pass the command as a list for safer execution, preventing shell injection vulnerabilities.
  • File changed: patchwork/common/utils/dependency.py
    Implemented a whitelist for allowed modules in import_with_dependency_group. The code now uses a whitelist of allowed module names to prevent loading arbitrary code through importlib.import_module().
  • File changed: patchwork/steps/CallShell/CallShell.py
    Fix subprocess shell=True vulnerability by using shell=False with argument list. Replaced shell=True with shell=False in subprocess.run() and used shlex.split to safely construct the command arguments to avoid shell injection risks.
@github-actions github-actions bot force-pushed the autofix-multiple-recipient-email branch 2 times, most recently from 5c73706 to 8c6d72a Compare March 6, 2025 09:05
@github-actions github-actions bot force-pushed the autofix-multiple-recipient-email branch from 8c6d72a to 6ced9b5 Compare March 6, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants