security(config+engine): opt-in strict shell-command mode + command_list (P0-03)#120
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
; curl evilthrough QA criteria commands or the autoresearch metric command. For SaaS-hosted / multi-tenant deploys that trust boundary is a real attack path.security.strict_shell_commands(default false — backward compatible). Strict mode also rejects|;&&||&><>>2>&1, naming the construct and pointing atcommand_list.config.ValidateShellCommand(cmd, strict)is now the single source —engine.ValidateConfigShellCommand[Mode]and autoresearch'svalidateMetricCommanddelegate (kills the drifting duplicate).config.Validatefails fast) AND at runtime (EvaluateCriteriaWithMode,QAConfig.StrictShellCommands,MetricHarness.StrictShellCommands).command_listcriterion field: entries run sequentially, all must pass, mutually exclusive withcommand. 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 byvalidCriterionKinds(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