mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 23:12:30 +02:00
Three defense-in-depth fixes around untrusted input flowing to subprocess execution:
1. **Control-pane HTTP server (scripts/lib/control-pane/server.js)**
The local control-pane API binds to 127.0.0.1 but had no Host or Origin
validation, so a DNS-rebinding attack from a malicious website could pivot
into the loopback endpoints — including POST /api/actions/:id, which spawns
'cargo run -- graph ...' with caller-supplied query strings. Add a hostname
allowlist (loopback variants plus the explicitly configured --host) and
reject mismatched Host (421) or non-loopback Origin (403) before any route
handler runs.
2. **OpenCode git-summary tool (.opencode/tools/git-summary.ts)**
The tool was building 'git diff ${baseBranch}...HEAD --stat' with execSync
and a raw model-supplied baseBranch string. Switch run() to execFileSync
with an args array (no shell), validate baseBranch against a conservative
git-ref allowlist (rejects shell metacharacters, leading -, embedded ..),
and clamp the depth arg to a small positive integer before interpolating
into 'git log --oneline -<N>'.
3. **Reusable test workflow (.github/workflows/reusable-test.yml)**
The 'Install dependencies' step interpolated ${{ inputs.package-manager }}
directly into a bash 'case' and into an echo, so a downstream caller that
forwarded attacker-controllable input could inject into the runner. Move
the input into a PACKAGE_MANAGER env var and reference $PACKAGE_MANAGER
inside the script per the GitHub script-injection guidance.
Detected by Aeon + semgrep p/security-audit (host check via threat-model
manual-review axis; git-summary via detect-child-process; workflow via
run-shell-injection).
Verification: node tests/run-all.js — 2686/2687 pre-existing tests pass; the
one failure (observe.sh legacy output fallback) reproduces on main without
this branch applied. Added 2 new control-pane tests covering the allowlist
classifier and the DNS-rebinding-gate behavior end-to-end.
---
Filed by [Aeon](https://github.com/aaronjmars/aeon-aaron).
Co-authored-by: aeonframework <aeon@aaronjmars.com>
|
||
|---|---|---|
| .. | ||
| auto-update.test.js | ||
| build-opencode.test.js | ||
| catalog.test.js | ||
| check-unicode-safety.test.js | ||
| claw.test.js | ||
| codex-hooks.test.js | ||
| consult.test.js | ||
| control-pane.test.js | ||
| discussion-audit.test.js | ||
| doctor.test.js | ||
| ecc-dashboard.test.js | ||
| ecc.test.js | ||
| gemini-adapt-agents.test.js | ||
| harness-audit.test.js | ||
| install-apply.test.js | ||
| install-plan.test.js | ||
| install-ps1.test.js | ||
| install-readme-clarity.test.js | ||
| install-sh.test.js | ||
| instinct-cli-projects.test.js | ||
| list-installed.test.js | ||
| loop-status.test.js | ||
| manual-hook-install-docs.test.js | ||
| npm-publish-surface.test.js | ||
| observability-readiness.test.js | ||
| openclaw-persona-forge-gacha.test.js | ||
| operator-readiness-dashboard.test.js | ||
| orchestrate-codex-worker.test.js | ||
| orchestration-status.test.js | ||
| platform-audit.test.js | ||
| post-bash-command-log.test.js | ||
| preview-pack-smoke.test.js | ||
| release-approval-gate.test.js | ||
| release-publish.test.js | ||
| release-video-suite.test.js | ||
| release.test.js | ||
| repair.test.js | ||
| session-inspect.test.js | ||
| setup-package-manager.test.js | ||
| skill-create-output.test.js | ||
| sync-ecc-to-codex.test.js | ||
| trae-install.test.js | ||
| uninstall.test.js | ||