fix: audit and remediate CLI reliability and security - #27
Merged
Merged
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b080-bf68-771d-991a-1eae34e74135 Co-authored-by: Amp <amp@ampcode.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.
Executive summary
Completed the CLI audit and the directly related Core/fetch audit on branch
audit/cli-fixes, updating this existing PR. The audit found 18 confirmed issues: 0 CRITICAL, 11 MAJOR, and 7 MINOR. All safely fixable findings are applied in source code with regression coverage; no new public flag, output, or credential-storage format was introduced.Issue counts by phase: Phase 0: 1; Phase 1: 6; Phase 2: 5; Phase 3: 2; Phase 4: 4; Phase 5: 0. Applied fixes: 18. Decision-required items: 3 policy/architecture items. Blocked checks: 2 environment-dependent lint/format commands.
Repository and CLI map
extensions/cli/src/index.ts, Commander command modules underextensions/cli/src/commands/.extensions/cli/src/ui/; standard/headless modes are selected in the index and command flow.extensions/cli/src/stream/streamChatResponse.tsand helpers; shared process/tool behavior also exists incore/.extensions/cli/src/onboarding.tsandconfigLoader.ts; credentials stay in~/.continue/.envand YAML references them.extensions/cli/src/tools/, including shell execution and permission checks.Issues table
extensions/cli/src/util/filePermissions.ts:8-13~/.continuefile or directoryextensions/cli/src/tools/runTerminalCommand.ts:260-333extensions/cli/src/util/clipboard.ts:90-95finallycleanup and testsextensions/cli/README.md:42-69,145-163extensions/cli/src/util/exponentialBackoff.ts:269-367extensions/cli/src/tools/index.tsx:160-178extensions/cli/src/tools/runTerminalCommand.ts:229-234extensions/cli/src/commands/serve.ts:622-651cn serveis activeextensions/cli/src/commands/serve.ts:488-494extensions/cli/src/stream/streamChatResponse.ts:307-375,extensions/cli/src/tools/index.tsx:243-291extensions/cli/src/services/ResourceMonitoringService.ts:51-69extensions/cli/src/tools/runTerminalCommand.ts:208-215,353-367core/tools/implementations/runTerminalCommand.ts:171-224,410-450,core/util/processTree.ts:9-41packages/fetch/src/stream.ts:111-139data: [DONE][DONE]; ping comments remain non-terminalextensions/cli/src/configLoader.ts:127-135,570-580cn --config ~/config.yaml~before loading/persistingpackages/fetch/src/fetch.ts:13-25VERBOSE_FETCH=1with anapi-keyheaderapi-keyredaction and testextensions/cli/src/version.ts:30-43,96-115{"version":42}extensions/cli/package-lock.json:5267-5275npm ciinextensions/cliAll 18 statuses:
Applied. No safely fixable finding remains deferred.Applied fixes
The new remediation commits are:
fc5df9441—fix: terminate cli and core process trees221a42a9c—fix: stop processing SSE data after doneb3e9fa70d—fix: validate cli config and update responses33199fc0c—test: avoid readonly process mock mutationc252a7c8c—fix: synchronize cli dependency lockfileThe source changes are covered by new or updated tests in CLI terminal/config/version tests, Core terminal timeout/cancellation tests, and fetch SSE/log-redaction tests. The before/after behavior is summarized in the issue table above; source code—not documentation only—was changed for every functional/security issue.
Verification
Passed:
npm test: 175 suites passed, 4 skipped; 1,842 tests passed, 7 skipped.npm ci --ignore-scripts --no-audit --include=optional.npm run lint: 0 errors; one pre-existing unused eslint-disable warning.npm run build:tsc.npm run tsc:check.npm run vitest -- tools/implementations/runTerminalCommand.timeout.vitest.ts: 6 passed.npm test -- --runInBand util/processTerminalStates.test.ts: 26 passed.npm test -- --run src/stream.test.ts src/logRedaction.test.ts: 15 passed.npx tsc -p tsconfig.json --noEmit.npm run build.npm audit --omit=dev --audit-level=moderate: 0 vulnerabilities.git diff --check.The full CLI run emitted existing EventEmitter/listener warnings from shared fixtures and the Core Jest run emitted existing duplicate-mock/ts-jest/open-handle warnings, but the tests passed.
Decisions required / residual risks
npm run format:checkcould not run because the root workspace has noprettierbinary; changed-file formatting passed using the CLI-local Prettier. Core package lint could not run because its local install lacks@typescript-eslint/parser; Core typecheck and targeted tests passed.Pull request
This is the existing single PR for the audit: #27, base
main, headaudit/cli-fixes. The branch is pushed and exactly one matching open PR exists. It was not merged.