Skip to content

fix(openclaw): yaml-escape Ollama model names in overlay generation#783

Merged
bussyjd merged 1 commit into
integration/v0.14.0-rc0from
fix/openclaw-ollama-yaml
Jul 16, 2026
Merged

fix(openclaw): yaml-escape Ollama model names in overlay generation#783
bussyjd merged 1 commit into
integration/v0.14.0-rc0from
fix/openclaw-ollama-yaml

Conversation

@bussyjd

@bussyjd bussyjd commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Medium from the PR #756 review. The #775 YAML-injection fix wrapped imported openclaw.json values but left Ollama-sourced model names (from the Ollama HTTP endpoint, unvalidated) interpolated raw into the generated overlay values YAML at two sites. Routes both through yamlScalar so a model name with YAML metacharacters can't inject overlay keys.

https://claude.ai/code/session_014YjPMViNrZ7zBVgUQzwEKk

The #775 injection fix wrapped imported values with yamlScalar() but
missed the two sites that interpolate names sourced from
listOllamaModels() (which JSON-decodes the local Ollama HTTP endpoint
with no charset validation): generateOverlayValues's model-list block
and patchOverlayModelList's overlay-update path both spliced the raw
model id/display-name into hand-built YAML lines. A model name
containing a newline plus a YAML key (e.g. "x\nimage:\n  repository:
evil") could inject new top-level keys into values-obol.yaml, later
applied to the cluster via helmfile sync.

Route both id and name through the existing yamlScalar() encoder at
both call sites. Added regression tests mirroring the #775
TestGenerateOverlayValues_RejectsYAMLInjection pattern for each
site, plus an injection subtest under TestPatchOverlayModelList; both
fail on the pre-fix code and pass after. Updated the three pre-existing
assertions that expected unquoted 'id: <model>' output, since
yamlScalar always double-quotes.

Claude-Session: https://claude.ai/code/session_014YjPMViNrZ7zBVgUQzwEKk
@bussyjd
bussyjd merged commit 6d17999 into integration/v0.14.0-rc0 Jul 16, 2026
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