patched-codes / patchwork

Automate code reviews, patching and documentation with LLM workflows.
https://patched.codes
GNU Affero General Public License v3.0
164 stars 10 forks source link

PatchWork AutoFix #322

Closed patched-admin closed 2 weeks ago

patched-admin commented 2 weeks ago

This pull request from patched fixes 2 issues.


* File changed: [patchwork/app.py](https://github.com/patched-codes/patchwork/pull/322/files#diff-839e90b808d34e4cf447eff0896161788ccfc6e1f2970be2e551b64ba413a503)
[Fixed vulnerability in find_patchflow function](https://github.com/patched-codes/patchwork/pull/322/files#diff-839e90b808d34e4cf447eff0896161788ccfc6e1f2970be2e551b64ba413a503L199-L219) Avoid using untrusted user input directly in importlib.import_module() function by first checking module_path with spec_from_file_location before importing the module.
* File changed: [patchwork/common/utils/dependency.py](https://github.com/patched-codes/patchwork/pull/322/files#diff-6ad070db06c1de59a1e0b0b199944f057089f121f94abdf817a0845e3c5d81f6)
[Fix vulnerability in dynamic import in importlib.import_module()](https://github.com/patched-codes/patchwork/pull/322/files#diff-6ad070db06c1de59a1e0b0b199944f057089f121f94abdf817a0845e3c5d81f6L1-L30) Avoid using dynamic values in `importlib.import_module()` function. Used a whitelist approach to prevent running untrusted code.