Skip to content

fix: security follow-ups from the 2026-11-26 issue run (skills allowlist, Devin fail-closed, Codex .git) - #4020

Merged
dyoshikawa merged 7 commits into
mainfrom
resolve-issue-4007-low-followups
Nov 29, 2026
Merged

dyoshikawa merged 7 commits into
mainfrom
resolve-issue-4007-low-followups

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Picks up the security-flavoured items and a few small correctness items from the umbrella of low review leftovers. Each item is its own commit.

What changed

Security-flavoured

  • Sources -> skills (feat(sources): install commands and subagents from declarative sources #4005 follow-up): a SKILL.md read from .rulesync/skills/.curated/ now keeps only canonical fields (targets, name, description, disable-model-invocation, user-invocable, license, compatibility, metadata). Every tool section (for example Claude Code allowed-tools and hooks) is dropped, with one warning per skill. This reuses keepCuratedFrontmatterKeys from feat(sources): install commands and subagents from declarative sources #4005 (new CURATED_SKILL_FRONTMATTER_KEYS). The body and companion files are kept. A local skill with the same name still keeps its tool sections. docs/guide/declarative-sources.md is updated.
  • Devin plugin hooks (feat(hooks): anchor devin-plugin hook commands to DEVIN_PLUGIN_ROOT #3982 follow-up): generated commands are now anchored as "${DEVIN_PLUGIN_ROOT:?}"/.... If an older Devin CLI leaves the variable empty, the shell stops with an error. Before, it ran /scripts/... from the filesystem root. This is the new failsClosedOnEmptyProjectDirVar converter option. Import accepts ${VAR:?} for every project-dir variable, so commands still round-trip to ./. Docs explain the :? and recommend failClosed: true on guard hooks.
  • Codex .git carve-out (fix(permissions): close the remaining all-tools withholding gaps (#3822) #3987 follow-up): an all-tools * restriction written with backslash separators (.git\hooks\**) is now also checked with /. Reading a \ escape as a separator only adds patterns that skip the carve-out, so the safe-side behaviour is kept. The over-dropping for */x and **/config is unchanged.

Correctness

Design decisions (made autonomously)

  • The skill allowlist keeps the root invocation flags and the Agent Skills packaging fields. They only narrow when a skill loads, or are informational. None of them grants tools, permissions or hooks.
  • I chose fail-closed (:?) over documenting a minimum version only. "$VAR" was already POSIX-only, so ${VAR:?} adds no new shell constraint. Note: bash exits 127 on :? and dash exits 2. So whether the hook blocks still depends on failClosed, but it never runs a root-level path.

Remaining items (not done here)

Verification

  • New unit tests: curated vs local skill frontmatter, Devin :? generate and import, Codex backslash patterns (shown failing before the fix), Codewhale formatting-only difference. Updated the Devin plugin e2e expectations.
  • pnpm run check, the full unit suite and pnpm run cicheck:content pass. Locally, vp test cannot find the runner because two vitest versions are installed (5.1.1 bundled with vite-plus, 5.1.2 direct). So the same suite was run with pnpm exec vitest run --silent=true on the same config. CI runs the normal path.

Refs #4007

🤖 Generated with Claude Code

https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4

dyoshikawa and others added 6 commits November 29, 2026 16:04
Skills installed from declarative sources passed their tool sections
(Claude Code allowed-tools and hooks, for example) through to the
generated files. Apply the same canonical-field allowlist that commands
and subagents from sources already use: a curated SKILL.md keeps
targets, name, description, the invocation flags and the Agent Skills
packaging fields, and every other key is dropped with a warning. The
body and companion files are kept.

Refs #4007

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…in hooks

Devin plugin hook commands were anchored as "$DEVIN_PLUGIN_ROOT"/..., so
on a Devin CLI older than v3000.5.20, which leaves the variable empty, a
hook ran /scripts/... from the filesystem root. Emit
"${DEVIN_PLUGIN_ROOT:?}"/... instead, so the shell stops with an error.
Import accepts the ${VAR:?} spelling for every project directory
variable, so the command still round-trips to ./.

Refs #4007

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…e Codex .git carve-out

An all-tools '*' deny spelled with Windows separators (.git\hooks\**)
did not count as restricting .git, so the default .git/** write
carve-out was still emitted. Check each pattern with / in place of \
as well; reading an escape as a separator only adds patterns that skip
the carve-out, which keeps the decision on the safe side.

Refs #4007

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
… reminder

The reminder compared trimmed strings, so a re-indented or CRLF copy
that generate leaves untouched (keeping its approved digest) was still
reported as changed. Use fileContentsEquivalent, the same comparison
that decides whether generate rewrites the file.

Refs #4007

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…ound trips

- Factory Droid keeps riskLevel only when every preToolUse hook that
  returns updatedInput sets preserveRiskLevel.
- Junie imports the shared .agents/ root flat, so nested Antigravity
  agents there are not imported as Junie agents.
- import --output-root pairs with generate --output-roots for a round
  trip to the same directory.

Refs #4007

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…-out and ${VAR:?} import

- Curated skills also drop metadata.openclaw and metadata.hermes, which
  OpenClaw and Hermes Agent read as gating and install settings, and a
  Codex agents/openai.yaml companion file (policy and MCP dependencies).
- The Codex .git carve-out reads restrictive :workspace_roots entries with
  / in place of \ too, through the same helper as the all-tools check.
- Only a tool that writes ${VAR:?} itself (the Devin plugin) converts it
  back to ./ on import; elsewhere a hand-written ${VAR:?} command is kept
  as written so it keeps failing closed.

Refs #4007

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
@dyoshikawa
dyoshikawa force-pushed the resolve-issue-4007-low-followups branch from d72d8e9 to 5a58f5f Compare November 29, 2026 07:11
@dyoshikawa
dyoshikawa merged commit c86330a into main Nov 29, 2026
10 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-4007-low-followups branch November 29, 2026 07:30
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