GHSA-8mpm-q7mh-8fvh
### 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) - Location: src/login.ts - Behavior: loginInternal(..., { local: true }) performs writeFileSync('.capgo', ...) before validating the API key with verifyUser(). - No checks are performed to prevent writing through a symlink. - Result: if .capgo is a symlink to an arbitrary path, the CLI overwrites the symlink target with attacker-controlled content (the provided API key string), even when login fails. Issue 2 - Arbitrary file overwrite via .capgo-credentials.json symlink (build credentials save --local) - Location: src/build/credentials.ts (local path is join(cwd(), '.capgo-credentials.json')) - Behavior: credentials are written using writeFile() without checking whether the destination is a symlink. - Result: if .capgo-credentials.json is a symlink to an arbitrary path, the CLI overwrites the symlink target with attacker-controlled JSON (including base64-encoded credential material). This occurs even if the user is not logged in / no API key exists. Issue 3 - Insecure default permissions for global credentials - Location: src/build/credentials.ts (global path $HOME/.capgo-credentials/credentials.json) - Observed permissions after save: -rw-rw-r-- (664) - Impact: credentials file contains sensitive signing material (e.g., Android keystore + Play config; iOS cert/profile/API key in other flows). World/group readability is unsafe on shared hosts and CI runners. Expected minimum: file 0600, directory 0700. #
Properties
- ghsa_id
- GHSA-8mpm-q7mh-8fvh
- severity
- high
- summary
- Capgo CLI: symlink-following local secret writes enable arbitrary file overwrite + world-readable credentials (0600 missing)
- cve_id
- GHSA-8mpm-q7mh-8fvh
- is_ghsa_only
- true
- ghsa_published
- 2026-03-18T16:09:42Z
- source_url
- https://github.com/advisories/GHSA-8mpm-q7mh-8fvh
- ghsa_updated
- 2026-03-18T16:09:44Z
Related Entities (5)
AFFECTS (1)
HAS_WEAKNESS (3)
REPORTED_BY (1)
Explore deeper with Ninja Signal's threat intelligence graph