Skip to content

security: patch command injection, path traversal, and unauthorized access - #34

Open
riverwolf67 wants to merge 1 commit into
cytostack:mainfrom
riverwolf67:main
Open

security: patch command injection, path traversal, and unauthorized access#34
riverwolf67 wants to merge 1 commit into
cytostack:mainfrom
riverwolf67:main

Conversation

@riverwolf67

Copy link
Copy Markdown
Contributor

This PR addresses several security vulnerabilities identified during a codebase audit:

  • Fixed Command Injection (Critical): Replaced execSync string interpolation with execFileSync and array-based arguments in CLI commands.
  • Secured Dashboard (High): Bound dashboard server to 127.0.0.1 and implemented token-based authentication.
  • Fixed Path Traversal (Medium): Added validation in CronEngine to prevent reading files outside the project root.
  • Mitigated DoS (Low): Added a 1MB file size limit to the file watcher broadcast.
  • Added Security Test Harness: Introduced an automated test suite using the native Node.js test runner.

See summary.md in the PR for details.

…ccess

- Fix critical command injection in CLI by using execFileSync
- Bind dashboard to localhost and add token-based authentication
- Prevent path traversal in CronEngine via path resolution validation
- Mitigate DoS in file watcher with 1MB broadcast limit
- Add security test harness using node:test
cytostack pushed a commit that referenced this pull request Jul 12, 2026
…mes, block path traversal

Reconciled with #34 (same vulnerabilities, independent audits); #34's
unique hardening lands in the follow-up commit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

# Conflicts:
#	pnpm-lock.yaml
cytostack added a commit that referenced this pull request Jul 12, 2026
…files (#54)

- execFileSync array-args for every remaining dynamic exec site
  (daemon-cmd, init, cron-engine, designqc-capture)
- 1 MB file-watcher broadcast cap (DoS guard)
- security regression test suite (node --test), incl. a guard test that
  fails the build if interpolated execSync ever returns
- isSensitiveFile(): anatomy/memory capture now excludes .pem/.key/.p8/
  .keystore/credentials/id_rsa/.npmrc/.tfstate etc., not just .env
  (closes #54)

Co-authored-by: riverwolf67 <6711592+riverwolf67@users.noreply.github.com>
Co-authored-by: bryandent <1007794+bryandent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant