POST /v1/personas/install passed git_url to `git clone` with no scheme
allowlist, no `--` separator, and no protocol restriction. Git runs
arbitrary code at clone time — BEFORE the install consent gate — for:
ext::sh -c <cmd> (ext transport executes the "URL" as a command)
--upload-pack=<cmd> (a "-"-leading URL is parsed as a git option)
Both bypass the module's own "install is a light trust event" promise,
and chain with the artifact-preview XSS (same-origin script + stolen API
token -> this endpoint -> RCE).
Fix: validate_git_url() allows only https:// and runs at the
clone_persona_repo chokepoint (before any clone, even an injected one).
git_clone additionally pins the transport (protocol.allow=never +
protocol.https.allow=always) and ends option parsing with `--`.
Fixes#521
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CLxsdFGXjdztTRNHjNgPXP
Sessions expose declared-and-connected only; 'all' is builtin-only; legacy true
migrates to the recommended refs, else nothing. Consent lists real names and
per-connector caps force re-consent when an update widens the grant.
Imported from andrewyng/aisuite@1b4bbf303e
(contents of its platform/ directory, hoisted to the repo root).
Development history prior to this commit lives in that repository.
Co-authored-by: Devika <devikaverma11@gmail.com>