GHSA-f9j4-qggq-h239: GitPython Remote.pull() refspec bypasses the --upload-pack unsafe-option guard, enabling arbitrary command execution
Remote.pull() in GitPython forwards its positional refspec argument directly to the git pull child process while its unsafe-option guard inspects only keyword arguments. An application that passes attacker-influenced data as the refspec (for example a user-supplied branch or refspec parameter in a web or CI service) can supply an option-shaped value such as --upload-pack=<command>. The value bypasses the unsafe_git_pull_options check, is placed after the -- separator on the git pull command line, and is executed as the upload-pack program for local-path or SSH transports. This yields arbitrary command execution with the privileges of the calling process using the documented default arguments (allow_unsafe_options=False).
References
- github.com/advisories/GHSA-f9j4-qggq-h239
- github.com/gitpython-developers/GitPython/commit/790bb3164948625ffb043d2a162425d55923fe9a
- github.com/gitpython-developers/GitPython/pull/2247
- github.com/gitpython-developers/GitPython/releases/tag/3.2.0
- github.com/gitpython-developers/GitPython/security/advisories/GHSA-f9j4-qggq-h239
Code Behaviors & Features
Detect and mitigate GHSA-f9j4-qggq-h239 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →