Skip to content

fix(security): remove inert curl-pipe deny rules from settings template#55

Merged
CodeWithJuber merged 1 commit into
masterfrom
claude/forgekit-usage-audit-186f98
Jul 11, 2026
Merged

fix(security): remove inert curl-pipe deny rules from settings template#55
CodeWithJuber merged 1 commit into
masterfrom
claude/forgekit-usage-audit-186f98

Conversation

@CodeWithJuber

Copy link
Copy Markdown
Owner

What & why

A usage audit flagged the two curl-pipe deny rules in
global/settings.template.json as malformed. Verification confirmed it: Claude
Code only honors :* as a trailing wildcard at the end of a Bash(...)
specifier — any text after it turns the colon into a literal, so these rules
matched no command that ever runs. They looked like a security control and
enforced nothing, and forge init copied them verbatim into every user's
~/.claude/settings.json.

The intended protection already exists and genuinely enforces at
global/guards/protect-paths.sh — a PreToolUse Bash hook that emits a
permissionDecision:"deny", which is the mechanism the Claude Code docs
recommend for constraining piped commands.

Changes

  • Remove the two inert deny rules from the settings template.
  • Tighten protect-paths.sh pipe-to-shell detection: was a space-only
    substring match; now a boundary-aware regex that also catches a no-space pipe
    and a zsh target, while still allowing legit pipes such as shellcheck.
  • Add test/settings_template.test.js — a regression guard: no Bash rule
    may embed a shell operator in its specifier, :* must be pattern-terminal,
    and the two removed rules must stay gone.

Note for reviewers

No enforcement is lost — the removed rules were dead; the real guard is
unchanged in behavior except for being broadened. Verified the guard blocks
| sh, no-space pipe, and zsh targets, and still allows shellcheck and
plain curl.

Checklist

  • npm test passes — 663/666; the one failure (imagine.test.js worktree
    sandbox) is pre-existing and unrelated (proven by stashing this diff)
  • npm run check passes for the changed files (pre-existing biome.json
    deprecation + warnings in other files are untouched)
  • New test added for the template rule shape
  • Conventional commit message (fix:)
  • CHANGELOG.md updated under ## [Unreleased]
  • No new runtime dependency
  • node src/cli.js docs check passes

Risk & rollback

  • Risk level: low
  • Rollback plan: revert this commit — restores the two (inert) rules and the
    previous guard match; no behavioral loss either way.

Extra checks

  • npm run typecheck passes
  • Input validated at boundaries; errors handled
  • Logs contain no secrets/PII

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

The two curl-pipe deny rules in global/settings.template.json were inert:
Claude Code only treats ":*" as a trailing wildcard at the END of a specifier,
so trailing text after it makes the colon a literal and the rule matches no
command that ever runs. They looked like a security control but enforced
nothing, and `forge init` copied them verbatim into users' settings.json.

The intended protection already exists and genuinely enforces at
global/guards/protect-paths.sh (a PreToolUse Bash hook) — the mechanism the
Claude Code docs recommend for constraining piped commands. This removes the
dead rules and tightens that guard to also catch a no-space pipe and a zsh
target, while still allowing legit pipes such as shellcheck.

Adds test/settings_template.test.js as a regression guard: no Bash rule may
embed a shell operator in its specifier, ":*" must be pattern-terminal, and the
two removed rules must stay gone.
@CodeWithJuber CodeWithJuber force-pushed the claude/forgekit-usage-audit-186f98 branch from 18722e5 to e05ca7d Compare July 11, 2026 21:27
@CodeWithJuber CodeWithJuber merged commit 899297b into master Jul 11, 2026
11 checks passed
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