Skip to content

Security: akleizor/ccmorph

Security

.github/SECURITY.md

Security

ccmorph stores credentials on disk. This document says exactly where, what protects them, and what does not — so you can decide whether to trust it with an API key before you do.

Reporting a vulnerability

Open an issue for anything already public. For anything that would expose a credential if described publicly, contact the maintainer directly rather than filing a public issue, and allow time for a fix before disclosure.

Include the ccmorph version (ccmorph --version), your OS and zsh version, and the smallest reproduction you have. Never paste a real key, token, or .conf file into a report — describe the shape instead.

Supported versions

The latest released version. There are no backported security fixes for older tags; update rather than patch in place.

What is stored, and where

Path Holds Mode
~/.config/ccmorph/<name>.conf one profile: API key, OAuth token, or an email for a subscription login. On macOS the key and token move to the login keychain on first use and the conf keeps only keychain:<name>.<key>; with no login keychain (Linux, CI, a throwaway $HOME) they stay in this file in plain text 600
login keychain, service ccmorph that profile's API key or OAuth token (macOS) keychain ACL
~/.config/ccmorph/profiles/<name>/models.json context limits ccmorph probe discovered for the profile's route; no credential 600
~/.config/ccmorph/ the state root (honours CCMORPH_STATE_DIR, then XDG_CONFIG_HOME) 700
~/.config/ccmorph/profiles/<name>/ that profile's Claude Code config, including its own auth state 700
${TMPDIR}/ccmorph-<uid>.log launch and adapter diagnostics ephemeral; created 600, and an existing log of ours is tightened to 600
${XDG_STATE_HOME:-~/.local/state}/ccmorph/usage/ one metadata receipt per response: profile, model, token counts, cost; no prompt, header or credential 600
${XDG_STATE_HOME:-~/.local/state}/ccmorph/usage-cursors/ one session transcript's read position for the usage hook; a path digest and an offset, no credential 600
<profile>/adapter/ a rendered translator config, created per session 700, removed on exit

Every *.conf is gitignored, including the manual context_window.<model> overrides it holds. No credential has ever been tracked in this repository.

What protects them

  • The usage hook holds no credential. A sub, token or provider launch adds one Stop hook that reads the session's own transcript after a stored offset. It reads only each assistant entry's id, model, timestamp and token counts: no prompt, header, cookie or credential is copied into a receipt, and the launch changes no network path, proxy or certificate. The hook command is a path and a profile name; the credential never appears on it.

  • Atomic writes. A profile is written to a mktemp file and renamed into place, so an interrupted write cannot leave a half-file that still parses.

  • Modes set before content. Files are created 600 and directories 700 before anything is written to them, not fixed up afterwards.

  • Symlink refusal. ccmorph removes a profile-local settings.json only when it is a symlink, and refuses to generate settings through a symlinked settings.json or settings.profile.json. Writers refuse to follow a symlink into a location they did not choose.

  • No credential in generated settings. A profile's settings.json is generated, but every variable a launch sets — endpoint and API key included — is left out of its env block; credentials reach Claude Code only through the process environment.

  • No credential in a log or an error. No log line or error message interpolates a key, a token, or a raw auth status payload.

  • No credential on a command line. Credentials reach Claude Code and the translator through the environment or a 600 file, never as an argument, so they do not appear in ps output.

  • Secret prompts do not echo. ccmorph add reads keys and tokens with read -rs, so they do not reach your terminal or your shell history.

  • Per-credential isolation. A profile holding a credential gets its own translator instance. A shared instance would let one profile spend another's credential, because the translator's inbound key list is instance-wide.

  • A non-subscription profile does not inherit your subscription. When seeding a new profile, OAuth caches and subscription markers are stripped.

  • The one-time profile-directory move renames, never copies. Relocating profile state from ~/.claude-profiles into the state root is an os.rename under an exclusive lock, so no credential is duplicated on disk and no mode is re-derived. It refuses to merge or overwrite when both locations hold real directories, refuses a cross-device move rather than falling back to a copy, and rolls back if it cannot leave the legacy path behind as a compatibility symlink. Native ~/.claude is not touched.

What does not protect them

Know these before trusting the tool with a key.

  • With no login keychain the credential sits in the conf unencrypted (Linux, CI, a throwaway $HOME): mode 600, file permissions alone, and a copy of the file is the credential itself. On macOS the same is true only until first use moves the key to the keychain.
  • The login keychain is not a boundary inside your own session. ccmorph reads the item back on every launch, with no passphrase, through the security command — and anything running as your user can run that same command and read the key too. What it does buy: the conf then holds only the keychain:<name>.<key> reference, so a copied, synced or stolen conf never holds the credential itself, and the item is encrypted at rest instead of lying in a readable file.
  • ccmorph cred <profile> prints a stored credential to stdout by design, for piping into another command. Redirect them deliberately; a shell that logs command output will capture the value.
  • local.sh is trusted executable zsh, sourced into ccmorph's process on launch. Anyone who can write it can already write lib/ccmorph.sh beside it, so it grants no new privilege — but it is code, not configuration. Read anything you copy into it.
  • --uninstall deliberately leaves your profiles in place, credentials and per-profile runtime state included. Removing the state root (~/.config/ccmorph, which now holds profiles/) is a separate, manual step.
  • A gateway you point a profile at receives your prompts. ccmorph does not inspect, filter, or retain them, and adds no telemetry of its own — but pointing a profile at an endpoint is a decision to send your conversations there.
  • Discovered context limits (profiles/<name>/models.json) are machine-local and route-bound. Never copy another host's .conf wholesale: its ceilings were probed against that host's route, and a wrong ceiling means a session that dies mid-conversation instead of compacting. A route change invalidates the stored discovery automatically; a manual context_window.<model> override is not route-bound and travels with the profile on purpose.

Network behavior

ccmorph itself makes only metadata requests — model listings and reachability probes — never inference, except where it says so:

  • ccmorph probe is metadata-only by default. Context-limit inference requires --allow-inference and a selected profile/model. Accepted requests may be billed.
  • Automatic compatibility uses cache and per-model protocol metadata first. If those cannot answer, it may send up to four requests for the selected model, capped at 8 output tokens for Messages/Chat or 16 for Responses within a 30-second classification deadline. Charges are disclosed before the check; successful verdicts are cached. No selected model means no paid inventory sweep.

--check skips persistence; inference remains a separate explicit opt-in.

Command, installation, and host-integration boundaries are defined in Scope and ownership.

There aren't any published security advisories