dream(host-adapters): fix host-openclaw YAML/shell injection via spec.name (evaluated) - #246
Draft
ruvnet wants to merge 2 commits into
Draft
dream(host-adapters): fix host-openclaw YAML/shell injection via spec.name (evaluated)#246ruvnet wants to merge 2 commits into
ruvnet wants to merge 2 commits into
Conversation
β¦ spec.name (evaluated) 4th confirmed sibling of #188 (hermes)/#212 (github-actions)/#224 (host-rvm): spec.name reached skillMarkdown()'s YAML frontmatter and installScript()'s shell double-quoted strings/comment line unescaped. Fixed with the same shellDq/commentSafe/YAML-bare-vs-quoted conventions already established in the prior two fixes. 6 new tests, all verified to fail against pre-patch code; 0 regressions (host-openclaw 19->25/25, bench 148/148). Independently critiqued (ACCEPT-WITH-CAVEATS) by a separate adversarial-review subagent. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pnj4gAQQuaZCszdWuj2k23
Backfills the 0/10-merged fact onto main (the #240 branch that first backfilled per-night detail is itself unmerged) and adds tonight's own row with the real PR number (#246). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pnj4gAQQuaZCszdWuj2k23
This was referenced Aug 31, 2026
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.
MetaHarness Dream Cycle, 2026-08-29. Rotation slot:
host-adapters(slot 4,scan: kernel,sdk). Full detail, ledger check, learning signals, competitor
research, and recommendations: #245.
Hypothesis
Given
@metaharness/host-openclaw'sskillMarkdown()andinstallScript()functions, when a
HarnessSpec.namereaching them through any caller thatbypasses the CLI's kebab-case
validateHarnessNamegate (direct SDK call,web-UI,
--from-existing) contains YAML- or shell-metacharacters, then thegenerated
SKILL.mdfrontmatter andinstall-openclaw.shshould render itas an inert string rather than corrupting the YAML document or executing
injected shell commands β subject to: byte-identical output for any name
without those characters, 0 regressions in the existing 19-test suite, and
new regression tests must fail against pre-patch code (red/green).
Candidate
Single file, one conceptual change:
packages/host-openclaw/src/index.ts.spec.namewas interpolated unescaped into (a) a YAML frontmattername:value in
skillMarkdown(), and (b) a bash comment line and severaldouble-quoted shell strings in
installScript(). This is the 4thconfirmed instance of the same vulnerability class already fixed in
host-hermes (#188, merged) and disclosed-but-unmerged in host-github-actions
(#212) and host-rvm (#224). Fixed with the exact same escaping conventions
as those two prior fixes for reviewer familiarity:
yamlValueSafe()/yamlDq()β bare when a safe identifier and not aYAML-reserved bare scalar, quoted+escaped otherwise (mirrors host-hermes's
yamlKey()).shellDq()β escapes backslash/double-quote/dollar/backtick for bashdouble-quoted strings (mirrors host-rvm's
shellDq()).commentSafe()β strips CR/LF for raw#-comment lines (mirrorshost-rvm's
commentSafe()).Checked host-copilot and host-prime-agent (the other adapters with similar
spec.name/a.nameinterpolation) for the same class: both onlyinterpolate into markdown body text, not a YAML/shell control position β
not exploitable, correctly left unfixed.
Evaluation Receipt
Deterministic code-correctness fix (no LLM calls needed;
LLM_EVAL=availablebut unused). 6 new tests added to
packages/host-openclaw/__tests__/openclaw.test.tscovering: YAML mapping-value injection (colon-space, raw newline) and shell
injection (comment-line newline,
$()command substitution, embeddeddouble-quote, backtick substitution). All 6 verified to fail against
pre-patch code (direct pre-patch run) and pass post-patch.
Baseline Comparison
host-openclawsuite: 19/19 (baseline) β 25/25 (candidate), 0 regressions.@metaharness/bench(imports the adapter): 148/148, 0 regressions.Full monorepo
npm run build: clean, 0 errors, all 4 phases.tsc --noEmit:clean.
Darwin Lineage
Not run β CLI-codegen escaping fix, not a genome/routing/topology/prompt/
tool/tier parameter; no bounded-evolution mutation surface applies (same
reasoning as #188/#212/#224).
Flywheel Evidence
Not applicable β generator-CLI correctness fix, not a harness-runtime
promotion candidate. Evidence retained as committed test files + gist +
issue #245.
Reward Hack Check
No test/benchmark weakened β 6 new tests, all additive, no existing
assertions loosened or thresholds changed. Independently confirmed by a
separate adversarial-critique subagent (not this candidate's author),
which re-verified the red/green claim itself via
git stash.Security Review
No new dependency, no new external destination. Net effect: closes a 4th
instance of an established RCE-class injection pattern. Independent critic
verdict: ACCEPT-WITH-CAVEATS β sound fix; one inherited (not new)
data-fidelity gap noted (
YAML_RESERVED_BAREdoesn't cover YAML-1.1y/n/hex/underscore-grouped numerics β copied verbatim fromhost-hermes's already-merged convention, not a new regression). The critic
also independently confirmed #224 (host-rvm shell RCE) has not merged
into
mainβ that RCE is live onmainright now.Regression Analysis
None found.
yamlValueSafe/shellDq/commentSafeare byte-identicalpassthroughs for any name matching the pre-existing safe-identifier
convention (all pre-existing tests pass unchanged).
ADR
None β this hardens an existing, already-reviewed pattern (same escaping
conventions as #188/#224); not a new architectural decision.
Research Gist
docs/dream-cycle/2026-08-29-gist.md(GIST=LOCALβ no gist-creation toolavailable in this session, matching every prior Dream Cycle night).
Includes OWASP MCP Top 10 grounding, competitor comparison (LangGraph,
AutoGen, CrewAI, OpenAI Agents SDK, Claude Agent SDK β none ship a
comparable built-in threat-model artifact), and the systemic
"no shared escaping utility exists" finding.
Issue
#245 (full findings, ledger check, 0/10-merged backlog signal, recommended
human actions).
Witness
Merge Policy
Human review required. Do not self-merge. Do not autonomously promote
Flywheel state.
Recommendation: ACCEPT for this PR itself (small, additive, fully
green, red/green-proven, independently critiqued). The more urgent human
action is triaging the review backlog: #212 and #224 (both disclosed
security fixes, the latter an RCE that is unpatched on
mainright now)should be reviewed before more Dream Cycle nights add a 5th instance of
this same bug class.
Generated by Claude Code