v2.24.1
Security
- The pull request checkout can no longer shadow the engine’s Python modules (#1093). The review starts the Python engine in the checked-out tree of the pull request.
python3 -mputs the working directory first onsys.path, so a file in the pull request, for exampleai_pr_review/__main__.pyoryaml.py, could run instead of the installed module. That code would run with the review’s API keys in its environment.- The image, the container action, the root action and the
parse-commandstep ofslash-commands.ymlnow setPYTHONSAFEPATH=1. This keeps the working directory offsys.path. - The fix reaches an image user only through the new image tag. Set
image-tagto2.24.1or leave it atlatest. A user ofcontainer-actionfrommainis covered at once, because the action passes the variable todocker run. - If you run
python3 -m ai_pr_review reviewby hand from a checked-out tree, setPYTHONSAFEPATH=1first. The GitLab and Bitbucket example pipelines now do this.SECURITY.mddescribes the requirement. - Tests start the real entrypoint in a hostile workspace and check that the shadow file does not run. Each test has a control run without the setting.
- The image, the container action, the root action and the