Skip to content

Full Code & Security Review — Implement All Fixes #19

@accesswatch

Description

@accesswatch

Task

Perform a full code review and security audit of the entire repository, then implement all appropriate fixes in a pull request.

Model note: Please use Claude Opus (the most capable model available to you) for this review. To set the model, go to Settings → Copilot → Coding agent in this repository and select Claude Opus before starting work.


Scope

Review every file in the repository across these categories:

Shell Scripts (.github/hooks/scripts/*.sh, .claude/hooks/*.sh)

  • Command injection risks — any unquoted variables passed to eval, exec, or shell expansion
  • Path traversal — any file path built from user-supplied or environment input without validation
  • grep, sed, awk patterns — portability across macOS (BSD) and Linux (GNU)
  • Error handling — exit codes, set -e correctness, trap on EXIT
  • Sensitive data — credentials, tokens, or secrets written to log files or stdout
  • World-writable temp files — use mktemp rather than predictable paths

PowerShell Scripts (*.ps1)

  • Injection risks — any Invoke-Expression or & with unsanitized input
  • Path traversal — Join-Path used consistently, no string concatenation for paths
  • Credential handling — no plaintext secrets, use SecureString where appropriate
  • Error handling — try/catch coverage, $ErrorActionPreference

JavaScript (desktop-extension/server/index.js, .github/hooks/scripts/*.js)

  • Input validation — all inputs from the hook payload or MCP tool calls validated before use
  • Command injection — any child_process.exec / spawn calls with user-supplied data
  • Path traversal — all file path operations use path.resolve + bounds check against allowed directories
  • Prototype pollution — any Object.assign or merge with untrusted data
  • Dependency audit — run npm audit and fix all high/critical vulnerabilities
  • Error handling — unhandled promise rejections, missing try/catch around async operations

JSON Configuration Files (.github/hooks/*.json, templates/*.json)

  • Schema validation — all fields typed and constrained
  • No hardcoded secrets or environment-specific values

Markdown / Documentation

  • No embedded credentials, tokens, or internal URLs
  • All example curl commands use HTTPS
  • Install script URLs point to the correct upstream repo

Install Scripts (install.sh, install.ps1, uninstall.sh, uninstall.ps1, update.sh, update.ps1)

  • curl | bash pattern — verify the URL is pinned to a specific release tag or SHA, not a mutable branch
  • Privilege escalation — no unnecessary sudo or elevation
  • Temp file safety — use mktemp, clean up on exit
  • Idempotency — safe to run multiple times without corrupting state

GitHub Actions / CI (if any .github/workflows/*.yml files exist)

  • pull_request_target misuse — untrusted code execution risk
  • Secret exposure — no secrets echoed to logs
  • Pinned action versions — @v3 style refs should be pinned to a commit SHA

Deliverables

  1. A pull request with all fixes applied
  2. A summary comment on this issue listing every finding and the fix applied (or the reason a finding was accepted risk)
  3. If npm audit finds vulnerabilities in desktop-extension/, include an updated package-lock.json

Out of Scope

  • Refactoring for style preferences
  • Adding new features
  • Changing agent content or documentation text (unless it contains a security issue)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions