Skip to content

fix: escape untrusted YAML values in generated workspace templates - #340

Open
o-mid wants to merge 1 commit into
theam:mainfrom
o-mid:fix/escape-generated-templates
Open

fix: escape untrusted YAML values in generated workspace templates#340
o-mid wants to merge 1 commit into
theam:mainfrom
o-mid:fix/escape-generated-templates

Conversation

@o-mid

@o-mid o-mid commented Sep 8, 2026

Copy link
Copy Markdown

Addresses #228.

Facility 0.12 no longer generates GitHub workflows or Claude settings, so the original doctor-watch, settings.json, and protect-branch regex vectors are gone. Model ids were still interpolated unquoted into agent YAML frontmatter, so values like a newline plus enabled: false, |, #, or $(id) could change structure or truncate the scalar.

This quotes every generated YAML scalar (models and environment commands) in both facility init and kickstart rendering, and adds hostile-input regressions through the CLI, core renderer, and agent parser.

Test plan

  • pnpm test --filter @theagilemonkeys/facility
  • pnpm test --filter @facility/core
  • pnpm test --filter @facility/agents
  • Confirm hostile model ids ($(id), foo"bar # pwned, newline + enabled: false, |) stay quoted scalars and parse as the original model string
  • Confirm ordinary ids (gpt-5.6-sol, dated claude-opus-4-8-20260101) still work after quoting
  • Confirm setup / start / ready commands with quotes and $(id) remain data, not shell

Quote model ids and environment commands as YAML scalars so hostile
input cannot inject keys, comments, or block scalars into kickstart
artifacts.
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