Skip to content

fix: adversarial hardening + POP dispatcher#11

Merged
jw409 merged 2 commits intomainfrom
feat/lib-comms
Mar 28, 2026
Merged

fix: adversarial hardening + POP dispatcher#11
jw409 merged 2 commits intomainfrom
feat/lib-comms

Conversation

@jw409
Copy link
Copy Markdown
Owner

@jw409 jw409 commented Mar 28, 2026

Summary

Two commits: the POP dispatcher/comms library, and a 9-file adversarial security + reliability audit.

POP Dispatcher (283d535)

  • Cheapest-first inference: gemini CLI ($0) → local GPU ($0) → cmax ($$$)
  • lib/comms.py: generate(), vm_generate(), health(), discover()

Adversarial Hardening (3e94a0c)

Sev File Fix
P0 lib/skills-core.js Path traversal — validateSkillName() rejects ../, /, \
P1 lib/comms.py Model ID → claude-sonnet-4-6-20250514, retry + backoff
P1 scanner.py ReDoS in MUST/NEVER lookahead → .{0,120} cap
P1 setup.sh Auto-register PostToolUse hook via jq
P1 mcp-servers/install.sh Unsafe cd → subshells, prebuilt binary detection
P1 .opencode/plugins/superpowers.js Sanitize env var against prompt injection
P2 hooks/agent-outcome-logger.py 10MB log rotation + crash-proof wrapper
P2 test_scanner.py Temp file leak → TemporaryDirectory, +nested test
P2 tests/claude-code/analyze-token-usage.py Typed exceptions, model-aware pricing, cache discounts

Test plan

  • python test_scanner.py — 10/10 pass
  • node -e "import('./lib/skills-core.js')..." — validateSkillName blocks traversal, allows valid names
  • All Python files parse clean (ast.parse)
  • cargo test on MCP servers (no changes to Rust code)

jw409 added 2 commits March 27, 2026 23:49
… fixes

Wave 1 (P0-P2):
- skills-core.js: path traversal via resolveSkillPath — validateSkillName()
  rejects ../, slashes, non-alphanumeric before path.join
- comms.py: stale model ID → claude-sonnet-4-6-20250514, retry with
  backoff for ConnectError/TimeoutException, exception class in logs
- agent-outcome-logger.py: 10MB rotation guard, crash-proof outer wrapper
- test_scanner.py: temp file leak → TemporaryDirectory, +nested dir test

Wave 2 (P1-P2, 5-agent team):
- scanner.py: ReDoS in MUST/NEVER lookahead → capped .{0,120}, skip
  .git/node_modules/__pycache__ in scan_directory
- setup.sh: auto-register PostToolUse hook via jq (idempotent), validate
  GSD dir exists before symlinking
- install.sh: unsafe cd → subshells, platform detection for prebuilt
  binaries, --build flag, better error context from cargo
- superpowers.js: sanitize OPENCODE_CONFIG_DIR against prompt injection,
  CRLF support in frontmatter regex, race condition guard on readFileSync
- analyze-token-usage.py: bare except → typed catch, MODEL_PRICING table
  (opus/sonnet/haiku), cache read 90% discount, type-safe dicts
@jw409 jw409 merged commit 33c4fb3 into main Mar 28, 2026
3 of 4 checks passed
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