Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-56236

CVE-2026-56236: Capgo CLI Path Traversal Vulnerability

CVE-2026-56236 is a path traversal vulnerability in Capgo CLI that allows attackers to overwrite files or expose credentials through malicious symlinks. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2026-56236 Overview

CVE-2026-56236 affects Capgo CLI versions prior to 12.128.2. The vulnerability stems from unsafe file operations in login and build credential handling routines. These routines follow symbolic links without validation, classified under [CWE-59] (Improper Link Resolution Before File Access).

An attacker who controls a repository can plant malicious symlinks that the CLI will follow during normal developer operations. This allows arbitrary file overwrite on the developer machine or exposure of credential files with world-readable permissions. Exploitation requires a developer to run the CLI inside an attacker-controlled repository, making this a supply chain risk for projects that consume untrusted Capgo configurations.

Critical Impact

Local attackers can overwrite arbitrary files or leak Capgo credentials by tricking developers into running the CLI against a repository containing crafted symlinks.

Affected Products

  • Capgo CLI versions prior to 12.128.2
  • Developer workstations executing capgo login operations
  • Build pipelines invoking Capgo credential operations against untrusted repositories

Discovery Timeline

  • 2026-06-21 - CVE-2026-56236 published to NVD
  • 2026-06-22 - Last updated in NVD database

Technical Details for CVE-2026-56236

Vulnerability Analysis

The Capgo CLI performs credential read and write operations during login and build workflows. The implementation opens target paths using standard file APIs without checking whether intermediate path components or the final target are symbolic links. When the CLI writes to a path such as a credentials cache or log file, the operating system transparently resolves any symlink and writes to the symlink's target instead.

This behavior provides a classic symlink attack primitive [CWE-59]. An attacker who can place files inside a repository can substitute expected output paths with links pointing to sensitive locations on disk. When a developer clones the repository and runs the CLI, the tool writes attacker-controlled content to those targets under the developer's privileges.

A second variant of the flaw involves credential file creation with overly permissive modes. Files containing Capgo authentication material are created world-readable, allowing any local user on a multi-tenant system to read tokens belonging to another account.

Root Cause

The root cause is missing link validation in the credential I/O paths. The CLI does not call lstat to detect symlinks before opening files, nor does it use O_NOFOLLOW flags when invoking open. File creation routines also omit explicit restrictive permission modes such as 0600, falling back to a permissive default umask result.

Attack Vector

The attack vector is local with required user interaction. An attacker prepares a public repository containing symlinks in paths the Capgo CLI writes to, then convinces a developer to clone the project and run a Capgo command. The CLI follows the symlinks, overwriting arbitrary files the developer's account can modify or exposing freshly written credential files to other local users.

Detection Methods for CVE-2026-56236

Indicators of Compromise

  • Unexpected modifications to files outside the working repository after Capgo CLI execution
  • Capgo credential files present with world-readable permissions (-rw-r--r-- or broader)
  • Symbolic links inside cloned repositories that point to paths under $HOME, /etc, or build system directories
  • Capgo CLI invocations in CI logs that target repositories from untrusted sources

Detection Strategies

  • Audit installed Capgo CLI versions across developer endpoints and build agents; flag any version below 12.128.2
  • Scan repositories before execution for symbolic links using find . -type l and review their targets
  • Monitor file integrity on developer home directories for writes initiated by node or capgo processes outside expected paths

Monitoring Recommendations

  • Log process execution of the Capgo CLI binary along with the working directory at invocation time
  • Alert on creation of files containing token-like strings with permission modes wider than 0600
  • Track CI/CD jobs that invoke Capgo commands against forked or external repositories

How to Mitigate CVE-2026-56236

Immediate Actions Required

  • Upgrade Capgo CLI to version 12.128.2 or later on all developer workstations and build agents
  • Rotate any Capgo authentication tokens that may have been written by a vulnerable CLI version
  • Review build pipelines for execution of the CLI against repositories that accept external contributions

Patch Information

The maintainers addressed the issue in Capgo CLI 12.128.2. Fix details are documented in the GitHub Security Advisory GHSA-8mpm-q7mh-8fvh and the VulnCheck Arbitrary File Overwrite Advisory. Update via the package manager used to install the CLI.

Workarounds

  • Avoid running the Capgo CLI inside repositories from untrusted sources until the upgrade is applied
  • Manually inspect repositories for symlinks before invoking any Capgo command
  • Restrict permissions on the Capgo credential directory to the current user only using chmod 700
bash
# Configuration example
npm install -g @capgo/cli@latest
capgo --version  # verify >= 12.128.2
chmod 700 ~/.capgo
find . -type l -exec ls -la {} \;  # audit repo for symlinks before CLI use

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.