fix(cli): audit round 2 — connect injection fix, charge/ship dedup, README - #75
Merged
Conversation
… dedup, README - SECURITY: `connect`'s openInBrowser ran exec() with the Connect URL double-quoted, but `$(...)` / backticks are still live inside double quotes — a malicious/compromised Connect Link could inject a shell command on the user's machine. Switched to execFile (no shell, literal argv) + reject non-http(s) URLs (assertHttpUrl — exported + tested). - charge + ship migrated onto the shared meta-input helper, dropping the duplicated resolve/parse pair (introduced for ledger/issue in round 1). - README: added the meta-tool commands (charge / ship / ledger / issue / discover / wizard / payment-status / verification-status — several were already missing) + the --project flag and CODESPAR_PROJECT env var. - init audited and left as-is — already safe: the name regex blocks path traversal and it refuses to write into a non-empty existing directory. Gate: turbo build + typecheck + test 54/54 green; CLI tests 23/23. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Round 2 of the
@codespar/cliaudit — closes the gaps the first pass left.🔴 Security —
connectbrowser-open shell injectionopenInBrowserranexec(\open ${JSON.stringify(url)}`). Double-quoting viaJSON.stringifydoes **not** neutralise$(...)or backticks (both stay live inside shell double-quotes), so a malicious/compromised **Connect Link URL** (server-controlled) could run an arbitrary command on the user's machine. Fixed: **execFile(no shell, URL passed as a literal argv)** + reject non-http(s) schemes viaassertHttpUrl` (exported + unit-tested).Cleanups
meta-inputhelper — drops the duplicated resolve/parse pair.--projectflag andCODESPAR_PROJECT.../traversal; refuses a non-empty existing dir) — no change.Gate
Core CI is billing-blocked (#73 pending). Verified locally:
turbo run build typecheck test→ 54/54, CLI tests 23/23 (added a connect URL-guard test).🤖 Generated with Claude Code