GitPython versions prior to 1.2.0.post0_12 contain a vulnerability where environment variables in URLs passed to Repo.create_remote() or Remote.add() are expanded and embedded into the repository configuration. This can lead to sensitive environment variables being written into .git/config and transmitted to attacker-controlled hosts during fetch or pull operations.
GitPython versions up to 3.1.53 contain a vulnerability in the Commit.count() method where unguarded forwarding of keyword arguments to git rev-list allows arbitrary file truncation. Specifically, using the output argument causes git rev-list to open and truncate the specified file to zero bytes before processing, enabling destruction of arbitrary files with the process's privileges. This vulnerability has a medium severity impact due to the integrity and availability loss but limited reachability and no content control over the truncation.
GitPython versions up to 3.1.53 have an incomplete denylist for unsafe git clone options that omits the --template option. This omission allows an attacker who can influence clone options and stage a malicious post-checkout hook in a directory to achieve arbitrary OS command execution during repository cloning. The vulnerability arises because git copies and executes hooks from the specified template directory during clone operations, and the default configuration does not block this option.
GitPython versions before 1.2.0.post0_13 contain unguarded forwarding of git command options in IndexFile.checkout() and TagReference.create(), allowing arbitrary file overwrite and arbitrary file read respectively. The checkout method forwards unsafe options to git checkout-index, enabling an attacker to overwrite files anywhere writable by the process using the --prefix option. The tag creation method forwards unsafe options to git tag, allowing reading arbitrary files via the -F/--file option. Both issues arise from missing safety checks on forwarded kwargs. A fix is available in version 1.2.0.post0_13.
GitPython's Repo.archive() method uses a denylist to block unsafe git archive options that could lead to arbitrary command execution or file writes. However, the denylist is incomplete and omits the --add-file and --add-virtual-file options, which allow reading arbitrary files from the filesystem and injecting attacker-controlled content into archives. This flaw enables an attacker who can influence the options passed to Repo.archive() to read arbitrary files on the host with the privileges of the running process. The issue is fixed in GitPython version 1.2.0.post0_13.
GitPython versions up to 3.1.53 contain a vulnerability in the check_unsafe_options guard that allows bypass via single-character keyword argument value token smuggling. This bypass enables arbitrary OS command execution through the --upload-pack git option in all guarded methods such as clone, fetch, and pull. The vulnerability arises because the guard only inspects option keys, not values, allowing crafted values to inject unsafe git options. A fix is available in version 2.16.0_12.
GitPython's Diffable.diff() method allows attacker-controlled arguments to be passed directly to git diff commands without proper validation, enabling arbitrary file overwrite via the git diff --output option. This can overwrite or corrupt files at the privilege level of the running process with attacker-chosen paths and diff content. The vulnerability affects versions up to 3.1.53 and has been fixed in version 2.16.0_12.
yt-dlp versions from 2.10.5 up to but not including 2.10.5_5 do not restrict file extensions for downloaded files, allowing creation of arbitrary filenames including executables. Because yt-dlp reads configuration files from the working directory and executes Windows executables found there, this can lead to arbitrary code execution. The issue is fixed in yt-dlp version 2024.07.01 by whitelisting allowed extensions. Users are advised to upgrade and follow recommended safe usage practices to mitigate risk.