molecule-core/platform
Security Auditor 284fb26558 fix(security): YAML-quote skill/prompt names in generateDefaultConfig + opaque file-write errors
Closes #460, #461.

**#460 — YAML injection via unquoted skill/prompt filenames**
`generateDefaultConfig` extracted skill directory names and prompt file
names from user-supplied `body.Files` keys and wrote them directly into
YAML list items without quoting:

  cfg.WriteString("  - " + s + "\n")

`validateRelPath` only blocks path traversal (`../`); it does NOT block
YAML control characters including newlines. On Linux, filenames can
contain newlines, so an attacker with any live workspace bearer token
could submit:

  {"files": {"skills/legit\nruntime: malicious/SKILL.md": "# skill"}}

The generated config.yaml would then contain `runtime: malicious` as a
top-level YAML key, overriding the runtime for workspaces provisioned
from the template.

Fix: extract `yamlEscape` as a reusable local from the same
`strings.NewReplacer` already used for the `name` field (#221) and apply
it to both the `skills:` and `prompt_files:` list items, wrapping each
in double-quotes.

**#461 — Docker error details in ReplaceFiles 500 responses**
`ReplaceFiles` returned `fmt.Sprintf("failed to write files: %v", err)`
in two 500 paths, where `err` comes from Docker API calls and may include
internal container names, volume names, and daemon error messages.

Fix: log the full error server-side and return a static opaque string to
the caller.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 05:40:45 -07:00
..
cmd/server chore: remove extracted directories, add manifest-driven Docker builds 2026-04-16 04:13:29 -07:00
internal fix(security): YAML-quote skill/prompt names in generateDefaultConfig + opaque file-write errors 2026-04-16 05:40:45 -07:00
migrations feat(channels): per-channel message budget with 429 enforcement (#368) 2026-04-16 11:17:14 +00:00
Dockerfile fix: address all code review findings + remove exposed secrets 2026-04-16 05:05:49 -07:00
Dockerfile.tenant fix: address all code review findings + remove exposed secrets 2026-04-16 05:05:49 -07:00
entrypoint-tenant.sh feat(tenant): combined platform + canvas Docker image with reverse proxy 2026-04-16 02:46:47 -07:00
go.mod initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
go.sum initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00