Skip to content

security(config+engine): opt-in strict shell-command mode + command_list (P0-03)#120

Merged
tzone85 merged 1 commit into
mainfrom
fix/p0-03-strict-shell-commands
Jul 16, 2026
Merged

security(config+engine): opt-in strict shell-command mode + command_list (P0-03)#120
tzone85 merged 1 commit into
mainfrom
fix/p0-03-strict-shell-commands

Conversation

@tzone85

@tzone85 tzone85 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Closes the documented YAML pipe/semicolon caveat (CLAUDE.md item 52): a copy-pasted hostile vxd.yaml could chain ; curl evil through QA criteria commands or the autoresearch metric command. For SaaS-hosted / multi-tenant deploys that trust boundary is a real attack path.
  • New security.strict_shell_commands (default false — backward compatible). Strict mode also rejects | ; && || & > < >> 2>&1, naming the construct and pointing at command_list.
  • config.ValidateShellCommand(cmd, strict) is now the single source — engine.ValidateConfigShellCommand[Mode] and autoresearch's validateMetricCommand delegate (kills the drifting duplicate).
  • Enforced at load time (config.Validate fails fast) AND at runtime (EvaluateCriteriaWithMode, QAConfig.StrictShellCommands, MetricHarness.StrictShellCommands).
  • New command_list criterion field: entries run sequentially, all must pass, mutually exclusive with command. Also wires the SP5 db-criteria fields (command, sql, expected_rows, schema_baseline) from vxd.yaml into the engine — previously dropped in the resume.go mapping and rejected by validCriterionKinds (dangling wire).

Tests

TestValidateShellCommand_StrictMode (16 cases), TestValidateShellCommand_StrictModeViaConfigValidate, TestConfigLoad_CommandListAsAlternative, TestEvaluate_MigrationSucceeds_CommandListRunsSequentially, TestEvaluate_MigrationSucceeds_StrictShellMode.

Closes WEAKNESSES.md P0-03.

🤖 Generated with Claude Code

Closes the documented YAML pipe/semicolon caveat (CLAUDE.md item 52):
a copy-pasted hostile vxd.yaml could chain `; curl evil` through QA
criteria commands or the autoresearch metric command. For SaaS-hosted /
multi-tenant deploys that trust boundary is a real attack path.

- New security.strict_shell_commands (default false — backward
  compatible; single-operator installs legitimately pipe QA output).
- config.ValidateShellCommand(cmd, strict) is the single source
  (engine.ValidateConfigShellCommand[Mode] and autoresearch's
  validateMetricCommand now delegate — kills the drifting duplicate).
  Strict mode also rejects | ; && || & > < >> 2>&1, naming the
  construct and pointing at command_list.
- Enforced at load time (config.Validate fails fast on qa
  success-criteria commands + autoresearch metric command) AND at
  runtime (EvaluateCriteriaWithMode / QAConfig.StrictShellCommands /
  MetricHarness.StrictShellCommands).
- New command_list criterion field: entries run sequentially, all must
  pass, mutually exclusive with command — multi-step work without shell
  metacharacters. Also wires the SP5 db-criteria fields (command, sql,
  expected_rows, schema_baseline) from vxd.yaml into the engine; they
  were previously dropped in the resume.go mapping and rejected by
  validCriterionKinds (dangling wire).
- Tests: TestValidateShellCommand_StrictMode (16 cases),
  _StrictModeViaConfigValidate, TestConfigLoad_CommandListAsAlternative,
  TestEvaluate_MigrationSucceeds_CommandListRunsSequentially,
  TestEvaluate_MigrationSucceeds_StrictShellMode.
- Docs: README security row, CLAUDE.md config block + item 52 closure.

Closes WEAKNESSES.md P0-03.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tzone85
tzone85 merged commit cdd66e5 into main Jul 16, 2026
@tzone85
tzone85 deleted the fix/p0-03-strict-shell-commands branch July 16, 2026 02:19
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.

2 participants