* File changed: [patchwork/common/utils/step_typing.py](https://github.com/patched-codes/patchwork/pull/1016/files#diff-4490efb269fda5b75b1edc5f5fa275d34675bca1ffbb22e06829384e562205ff)Whitelist allowed modules for `importlib.import_module()` to prevent arbitrary code execution. Introduced a whitelist to allow only specific modules to be imported. This prevents arbitrary and potentially harmful code execution from untrusted user input.
* File changed: [patchwork/app.py](https://github.com/patched-codes/patchwork/pull/1016/files#diff-839e90b808d34e4cf447eff0896161788ccfc6e1f2970be2e551b64ba413a503)Ensure safe module imports by implementing a whitelist approach Replaced dynamic import_module calls with a whitelist of allowed modules to prevent execution of untrusted code.
* File changed: [patchwork/common/utils/dependency.py](https://github.com/patched-codes/patchwork/pull/1016/files#diff-6ad070db06c1de59a1e0b0b199944f057089f121f94abdf817a0845e3c5d81f6)Implementing whitelist for importlib to prevent loading arbitrary modules. The code was updated to use a whitelist approach, ensuring that only predefined module names are allowed to be imported with `importlib.import_module()`. This prevents the execution of potentially harmful, untrusted code.
This pull request from patched fixes 3 issues.
Whitelist allowed modules for `importlib.import_module()` to prevent arbitrary code execution.
Introduced a whitelist to allow only specific modules to be imported. This prevents arbitrary and potentially harmful code execution from untrusted user input.Ensure safe module imports by implementing a whitelist approach
Replaced dynamic import_module calls with a whitelist of allowed modules to prevent execution of untrusted code.Implementing whitelist for importlib to prevent loading arbitrary modules.
The code was updated to use a whitelist approach, ensuring that only predefined module names are allowed to be imported with `importlib.import_module()`. This prevents the execution of potentially harmful, untrusted code.