fix: escape untrusted YAML values in generated workspace templates - #340
Open
o-mid wants to merge 1 commit into
Open
fix: escape untrusted YAML values in generated workspace templates#340o-mid wants to merge 1 commit into
o-mid wants to merge 1 commit into
Conversation
Quote model ids and environment commands as YAML scalars so hostile input cannot inject keys, comments, or block scalars into kickstart artifacts.
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.
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 initand kickstart rendering, and adds hostile-input regressions through the CLI, core renderer, and agent parser.Test plan
pnpm test --filter @theagilemonkeys/facilitypnpm test --filter @facility/corepnpm test --filter @facility/agents$(id),foo"bar # pwned, newline +enabled: false,|) stay quoted scalars and parse as the original model stringgpt-5.6-sol, datedclaude-opus-4-8-20260101) still work after quotingsetup/start/readycommands with quotes and$(id)remain data, not shell