ECC/tests/lib
Affaan Mustafa 5994d3fac1 fix(security): contain install-state file ops to trusted root — RCE fix (GHSA-hfpv-w6mp-5g95)
Critical: project-local install-state (e.g. a cloned repo's .cursor/ecc-install-state.json)
is attacker-controllable, and repair/uninstall/auto-update replayed its operations with
destinationPath validated only for non-emptiness — confirmed arbitrary file write/delete
and chained RCE (write ~/.bashrc, .git/hooks, or run a planted install-apply.js).

- New scripts/lib/path-safety.js: assertWithinTrustedRoot() canonicalizes (incl. symlink
  escape via nearest-existing-ancestor realpath) and fails closed unless the destination is
  within the adapter-derived trusted root.
- install-lifecycle.js: gate executeRepairOperation + executeUninstallOperation + the
  install-state removal against record.targetRoot (the adapter-resolved root, NOT the
  attacker-supplied state.target.root).
- auto-update.js: validateRepoRoot now requires package.json name to be an official ECC
  package, so a planted nested repo can't drive auto-update into executing attacker code.
- 7 containment regression tests. Existing install-lifecycle/repair/uninstall/auto-update
  suites still green (legit destinations are within the root).
2026-06-18 19:54:22 -04:00
..
agent-compress.test.js chore: reconcile publish/agent surfaces after PR batch 2026-06-15 14:21:28 -04:00
agent-data-home.test.js feat: Cursor-independent ECC memory via ECC_AGENT_DATA_HOME (#2066) 2026-06-07 13:27:00 +08:00
changed-files-store.test.js fix: port safe ci cleanup from backlog 2026-04-01 16:09:54 -07:00
command-plugin-root.test.js fix(commands): resolve active plugin root in /instinct-status (#2037) (#2059) 2026-06-07 13:27:05 +08:00
control-pane-actions.test.js feat: add ECC2 local control pane (#2131) 2026-06-03 21:54:30 +08:00
control-pane-state.test.js feat(control-pane): add agent+human JIT assignment view to the work-items board 2026-06-18 16:59:30 -04:00
cost-estimate.test.js feat: add ECC statusline observability hooks 2026-05-11 23:44:06 -04:00
dry-run.test.js feat: add dry-run mode for hook execution (#2116) (#2188) 2026-06-15 14:01:21 -04:00
github-coordination.test.js fix: address second round of code-review findings 2026-06-11 14:25:58 -04:00
inspection.test.js feat: agent compression, inspection logic, governance hooks (#491, #485, #482) (#688) 2026-03-20 01:38:13 -07:00
install-config.test.js feat: add install catalog and project config autodetection 2026-03-27 05:56:39 -04:00
install-executor.test.js feat: add Ruby and Rails rules 2026-05-13 06:27:08 -04:00
install-lifecycle.test.js test: cover install lifecycle edge paths 2026-04-29 17:56:25 -04:00
install-manifests.test.js feat: add zed install target 2026-05-17 07:06:49 -04:00
install-request.test.js fix(installer): harden locale docs install 2026-05-17 20:46:04 -04:00
install-state.test.js fix: harden release surface version and packaging sync (#1388) 2026-04-12 22:33:32 -07:00
install-targets.test.js fix: retire rules/zh from the always-loaded default rules install (#2170) 2026-06-07 13:25:56 +08:00
locale-install.test.js docs(i18n): add German localization scout (#2029) 2026-05-25 14:12:01 -04:00
mcp-config.test.js feat: support disabling bundled mcp servers 2026-04-05 14:37:28 -07:00
mcp-inventory.test.js feat: MCP inventory (ecc.mcp.v1) — unified cross-harness MCP config view (#2146) 2026-06-06 03:55:17 +08:00
observer-sessions.test.js fix: port continuous-learning observer fixes 2026-05-11 03:35:42 -04:00
orchestration-session.test.js fix: retire legacy command shims from default surface 2026-04-29 23:56:40 -04:00
package-manager.test.js fix: harden Trae install ownership (#1013) 2026-03-30 02:01:54 -04:00
path-safety.test.js fix(security): contain install-state file ops to trusted root — RCE fix (GHSA-hfpv-w6mp-5g95) 2026-06-18 19:54:22 -04:00
project-detect.test.js fix(project-detect): match packageKeys on boundaries, not substrings (#2181) 2026-06-07 13:25:34 +08:00
resolve-ecc-root.test.js fix: salvage remaining stale queue fixes (#1754) 2026-05-11 16:41:08 -04:00
resolve-formatter.test.js fix: harden Trae install ownership (#1013) 2026-03-30 02:01:54 -04:00
selective-install.test.js test: normalize zed install path assertion 2026-05-17 07:27:05 -04:00
session-adapters-codex.test.js feat: extend session-adapter layer with codex-worktree + opencode adapters (#2145) 2026-06-06 03:55:00 +08:00
session-adapters-opencode.test.js feat: extend session-adapter layer with codex-worktree + opencode adapters (#2145) 2026-06-06 03:55:00 +08:00
session-adapters.test.js test: cover session adapter edge cases 2026-04-29 18:21:31 -04:00
session-aliases.test.js test: skip chmod-based permission tests when running as root (#2171) 2026-06-07 13:25:53 +08:00
session-bridge.test.js test(lib): make concurrent-write test actually concurrent + use regex matcher for assert.throws 2026-05-19 04:57:10 -04:00
session-manager.test.js test: skip chmod-based permission tests when running as root (#2171) 2026-06-07 13:25:53 +08:00
shell-split.test.js fix(hooks): allow tmux-wrapped dev server commands (#321) 2026-03-07 14:47:49 -08:00
skill-dashboard.test.js test: cover skill dashboard edge paths 2026-04-29 19:15:47 -04:00
skill-evolution.test.js test: cover skill tracker edge paths 2026-04-29 19:21:03 -04:00
skill-improvement.test.js feat: self-improving skills loop — observe, inspect, amend, evaluate 2026-03-14 23:21:18 -07:00
state-store.test.js feat: sync GitHub queue into work items 2026-05-11 13:07:29 -04:00
tmux-worktree-orchestrator.test.js fix: retire legacy command shims from default surface 2026-04-29 23:56:40 -04:00
transcript-context.test.js fix: resolve four bug reports (#2290, #2282, #2276, #2272) 2026-06-18 16:49:58 -04:00
utils.test.js feat: Cursor-independent ECC memory via ECC_AGENT_DATA_HOME (#2066) 2026-06-07 13:27:00 +08:00
worktree-lifecycle.test.js feat: worktree-lifecycle service (deterministic conflict prediction + safe GC) (#2164) 2026-06-07 13:00:08 +08:00