Skip to content

fix(validation): prevent validation lead from executing arbitrary local commands#63

Open
ganesh47 wants to merge 1 commit intomainfrom
codex/fix-llm-supplied-command-execution-vulnerability
Open

fix(validation): prevent validation lead from executing arbitrary local commands#63
ganesh47 wants to merge 1 commit intomainfrom
codex/fix-llm-supplied-command-execution-vulnerability

Conversation

@ganesh47
Copy link
Copy Markdown
Owner

Motivation

  • The validation lead could return arbitrary shell commands in its LLM-produced plan which were executed by runCommandSet via the system shell, creating a path for command injection and host compromise.
  • The intent is to remove the trust boundary that directly executes model-supplied commands while preserving the deterministic, inferred local checks used by validation.

Description

  • Add selectApprovedLocalValidationCommands(requested, inferred) which dedupes and returns the intersection of the model-requested commands with the deterministic initialPlan.localValidation.commands.
  • Use the approved command list (approvedLocalCommands) instead of validationPlan.localValidation.commands when invoking runCommandSet and when populating the requestedCommands field for skipped runs.
  • Preserve existing runCommandSet behavior and tool-wrapper preparation so approved inferred commands run unchanged while any additional LLM-emitted commands are ignored.

Testing

  • Ran npm test -- test/validation.test.ts, which completed successfully (1 file passed, 6 tests passed).
  • Ran npm test -- test/deliver.test.ts; the validation/deliver scenarios executed and produced logs, but the test run output was large and truncated in the execution environment so a final summary could not be captured here.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant