Aug 8, 2026·5 min read·1 visit
A path traversal vulnerability in go-git allows malicious repositories to overwrite files outside the worktree via crafted symbolic links, potentially leading to remote code execution.
A symbolic link directory traversal vulnerability was identified in go-git, a pure Go implementation of the Git specification. This vulnerability allows an attacker to construct a repository that, when checked out or processed, bypasses directory boundaries to write or overwrite arbitrary files on the host filesystem.
An arbitrary file write vulnerability exists in the worktree implementation of go-git, a widely integrated pure Go implementation of the Git specification. The flaw arises during repository checkout operations when processing paths containing symbolic links that resolve outside the designated worktree directory.\n\nSecurity tools, integrated development environments (IDEs), and continuous integration (CI/CD) pipelines frequently rely on go-git to programmatically clone, fetch, and analyze untrusted remote repositories. This specific vulnerability exposes these automated systems and client environments to high-severity integrity risks.\n\nThe vulnerability, cataloged as CVE-2026-71556 and GHSA-hc8v-wwc9-vgxm, represents a failure to ensure that physical paths map strictly to the intended virtual boundary. An attacker who successfully influences a repository configuration can leverage this discrepancy to execute arbitrary file operations on the host system.
The root cause of this vulnerability lies in the divergence between lexical path validation and physical path resolution. The worktreeFilesystem component in go-git previously restricted operations to the worktree using a string-based validation function named validPath. This function analyzed path strings to detect parent directory segments, metadata directories, and alternative filesystem stream markers.\n\nWhile lexical path checking successfully identifies direct attempts to traverse boundaries, it does not account for the state of the physical filesystem. If a repository contains a symbolic link that points to a path outside the worktree, the operating system's file creation APIs resolve the link dynamically during write operations.\n\nWhen the checkout process creates a symbolic link followed by a file situated logically beneath that link, the lexical check evaluates the second file's path string as benign. The underlying filesystem driver subsequently resolves the previously created symbolic link, which permits the file write operation to escape the root boundary of the worktree.
The vulnerability is resolved by introducing active path state validation and proactive cleanup of blocking symlinks prior to file creation. The implementation introduces clearBlockingSymlinks, which recursively verifies the target path from the shallowest directory component downward.\n\ngo\nfunc (w *Worktree) clearBlockingSymlinks(name string) error {\n\tvar dirs []string\n\tfor dir := filepath.Dir(name); dir != \".\" && dir != \"\" && dir != string(filepath.Separator); dir = filepath.Dir(dir) {\n\t\tdirs = append(dirs, dir)\n\t}\n\tfor i := len(dirs) - 1; i >= 0; i-- {\n\t\tfi, err := w.Filesystem.Lstat(dirs[i])\n\t\tif err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\tif fi.Mode()&os.ModeSymlink != 0 {\n\t\t\treturn w.Filesystem.Remove(dirs[i])\n\t\t}\n\t}\n\tfi, err := w.Filesystem.Lstat(name)\n\t// ... remaining check for final component symlink\n}\n\n\nAdditionally, the worktreeFilesystem wrapper was hardened to perform on-disk validation via validNoLeadingSymlink for every read and write operation. This ensures that any path containing a leading component that physically exists on disk as a symbolic link is rejected before passing the path to the physical driver.
To execute this attack, an operator must craft a repository with specific directory structures. The repository must define a symbolic link entry whose target points outside the intended worktree directory, such as the localized .git metadata directory or system configuration folders.\n\nA second file entry is then added to the repository using a logical path nested within the symbolic link component. For example, if the symbolic link is named s and points to .git, the subsequent file is defined at s/config.\n\nWhen a vulnerable client performs a checkout, the application materializes the symbolic link s. When it proceeds to write s/config, the lexical parser permits the write, and the operating system follows the symbolic link to overwrite the repository's .git/config file.\n\nmermaid\ngraph LR\n A[\"Client Clones Malicious Repo\"] --> B[\"Checkout Writes Symlink 's'\"]\n B --> C[\"Checkout Processes Path 's/config'\"]\n C --> D[\"Lexical Check Approves 's/config'\"]\n D --> E[\"OS Resolves Symlink 's' to Target\"]\n E --> F[\"Attacker Payload Overwrites Target File\"]\n
The primary consequence of this vulnerability is unauthorized file modification and absolute file write capabilities within the security context of the user executing go-git. Because Git configurations control command execution parameters, this primitive easily leads to remote code execution.\n\nBy overwriting the repository's local .git/config file, an attacker can define malicious Git configurations such as custom core pagers, file system monitors, or post-checkout hooks. These configurations are executed automatically during subsequent Git operations performed by the host environment.\n\nThe vulnerability represents a CVSS score of 7.1, indicating high severity. The main limiting factor is the requirement of user interaction, as the victim must actively clone, pull, or checkout the malicious repository to trigger the exploit.
The definitive remediation for CVE-2026-71556 requires updating the go-git library to a patched version. Maintainers have released versions 5.19.2 and 6.0.0-alpha.5 to address the flaw across affected release branches.\n\nWhere immediate patching of the underlying library is impractical, operational mitigations should be applied. Deploying Go applications within ephemeral containerized environments ensures that out-of-bounds writes do not impact the underlying host filesystem or modify persistent configuration files.\n\nAdditionally, development teams can integrate static analysis tools such as govulncheck into build pipelines. This automated scanning flags instances of vulnerable go-git versions within the compiled binaries before deployment.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L| Product | Affected Versions | Fixed Version |
|---|---|---|
go-git go-git | < 5.19.2 | 5.19.2 |
go-git go-git | >= 6.0.0-alpha.1, < 6.0.0-alpha.5 | 6.0.0-alpha.5 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-59 |
| Attack Vector | Network |
| CVSS Score | 7.1 (High) |
| Exploit Status | None / Poc Conceptual |
| CISA KEV Status | Not Listed |
| Primary Weakness | Improper Link Resolution Before File Access |
Improper Link Resolution Before File Access ('Link Following')
CVE-2026-71557 is a path traversal vulnerability in go-git, a pure-Go implementation of Git. In vulnerable versions, the filesystem-backed storage engine fails to validate reference names before mapping them to on-disk paths. An attacker hosting a malicious Git server can advertise references containing directory traversal sequences, such as 'refs/heads/../../config', to write or overwrite files outside the intended reference storage directory.
An information disclosure vulnerability in the Nuxt development server allows adjacent network attackers to retrieve the absolute project root directory and a persistent workspace UUID by querying the unprotected Chrome DevTools workspace endpoint. This occurs when the development server is bound to a network-reachable interface, allowing requests that bypass the header-based security verification checks.
A Regular Expression Denial of Service (ReDoS) vulnerability exists in SvelteKit's content negotiation header parser prior to version 2.70.2. An unauthenticated remote attacker can exploit this vulnerability by sending a crafted Accept header with highly repetitive malformed values. This triggers catastrophic backtracking on the single-threaded Node.js/Bun event loop, leading to CPU exhaustion and full denial of service.
An OS command injection vulnerability exists in the npm package loading component of the jsii-diff CLI tool within the AWS jsii framework. Prior to version 1.131.0, when parsing package specifiers prefixed with `npm:`, the tool concatenated user-controlled inputs directly into a shell execution string via child_process.exec. This allows attackers to execute arbitrary shell commands under the context of the running Node.js process.
CodeIgniter4 versions prior to v4.7.4 contain a protocol-spoofing vulnerability due to improper verification of upstream reverse proxy forwarding headers. Remote, unauthenticated attackers can inject headers like X-Forwarded-Proto to deceive the framework into identifying an insecure HTTP request as a secure HTTPS connection.
An SQL injection vulnerability exists in the Query Builder component of the CodeIgniter4 full-stack PHP framework. The vulnerability is located within the compilation logic of the batch delete operation, deleteBatch(). When an application chains where() conditions prior to calling deleteBatch(), the Query Builder fails to enforce or respect the escaping flags of the parameters bound to the WHERE clauses. Instead of passing these parameters through the database driver standard escaping logic, the compilation engine interpolates the raw, unescaped bound values directly into the compiled SQL string, allowing remote attackers to execute arbitrary SQL commands.