Skip to content

Fix frontmatter depth-cap bypass and shell-quote server-supplied names in hints - #410

Merged
jancurn merged 1 commit into
mainfrom
claude/trusting-archimedes-g1z57n
Sep 20, 2026
Merged

jancurn merged 1 commit into
mainfrom
claude/trusting-archimedes-g1z57n

Conversation

@jancurn

@jancurn jancurn commented Sep 20, 2026

Copy link
Copy Markdown
Member

Two small fixes from the v0.7.0-beta.1 release security review, plus the review write-up. A hostile SKILL.md could crash the CLI with a stack overflow despite the 32-level nesting cap, and the copy-paste hints after skills-get, resources-directory-read and resources-read interpolated server-supplied names unquoted, so a skill named pdf; curl … | sh # produced a hint that ran the injected command.

  • Check the nesting depth at the top of parseMapping and parseSequence, which recurse into each other directly and bypassed the check in parseBlock; an 8.6 MB alternating frontmatter now fails with a parse error instead of a RangeError.
  • Route the four hint sites through quoteShellArg() (formatPath() now delegates to it); unit tests cover hostile names and URIs.
  • Add the beta.1 addendum to docs/security-review-2026-09.md and correct H5 to "partially fixed": profiles created before 0.7 still refresh at whatever authorization server the MCP server points to. Everything else in the addendum is left for follow-ups.

Refs #401, #408

🤖 Generated with Claude Code

https://claude.ai/code/session_01J7TdVXNthTXXbmDtGJ7sYm


Generated by Claude Code

…erver names in hints

The nesting cap in the SKILL.md frontmatter parser was checked only in
parseBlock and parseScalarOrFlow, but parseMapping and parseSequence
recurse into each other directly, so a frontmatter alternating `- key:`
items and same-indent lists reached depth 2400+ and, at ~8.6 MB (inside
the 10 MB IPC cap), crashed the CLI with a RangeError instead of the
parse error the changelog promised. The check now runs at the top of
both functions.

The next-step hints printed by skills-get, resources-directory-read and
resources-read interpolated the server-supplied skill name and resource
URIs unquoted, so a skill named `pdf; curl … | sh #` yielded a hint that
ran the injected command when pasted or followed by an agent. All four
sites now go through quoteShellArg(), which formatPath() delegates to.

Also records the v0.7.0-beta.1 release review in
docs/security-review-2026-09.md and corrects the H5 status to partially
fixed: profiles created before 0.7 still refresh at whatever
authorization server the MCP server points to.

Refs #401, #408

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J7TdVXNthTXXbmDtGJ7sYm
@jancurn
jancurn merged commit b9c1a9e into main Sep 20, 2026
7 checks passed
@jancurn
jancurn deleted the claude/trusting-archimedes-g1z57n branch September 20, 2026 10:53
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.

2 participants