Skip to content

fix(build): block repo-configured verification commands from executing#65

Open
ganesh47 wants to merge 1 commit intomainfrom
codex/propose-fix-for-rce-vulnerability
Open

fix(build): block repo-configured verification commands from executing#65
ganesh47 wants to merge 1 commit intomainfrom
codex/propose-fix-for-rce-vulnerability

Conversation

@ganesh47
Copy link
Copy Markdown
Owner

Motivation

  • Prevent untrusted repository-local config from supplying verificationCommands that are executed on the host shell during cstack build, which allowed arbitrary command execution.
  • Preserve existing behavior for verification commands that come from the user or default config while blocking unsafe repo-sourced values.

Description

  • Add provenance tracking for workflows.build.verificationCommands and verification.defaultCommands in src/types.ts and src/config.ts so sources are recorded as default, user, or repo.
  • Update loadConfig to populate the new provenance fields by checking workflows.build.verificationCommands and verification.defaultCommands locations in parsed documents in src/config.ts.
  • Change runBuild in src/commands/build.ts to ignore verification commands whose provenance is repo and only use verification commands from user or default sources, while keeping fallback semantics between workflow-specific and default commands.

Testing

  • Ran npm test -- test/config.test.ts, which passed.
  • Ran npm run -s typecheck, which passed.
  • Note: an earlier run of npm test -- test/config.test.ts test/build.test.ts surfaced failures in test/build.test.ts during iterative fixes; the final PR includes only the provenance and build-gating changes and validation above.

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