[BUG] Heredoc pipe bypass still present in v2.1.141 (#48518 still not fixed)

Status Closed — not planned
Maintainer reply None cached
Activity 8 comments · opened May 14, 2026 · closed Jun 20, 2026

This is a continuation of issue #48518, which was locked but still reproduces as mentioned by @spawnia on v2.1.104 and potentially higher .

The fix introduced in v2.1.73 only fixed the CPU loop/freeze symptom, but the underlying permission bypass remains. When a heredoc marker (<<EOF or <<'EOF') is the first token after the command name, the permission system fails to evaluate pipe targets. An ask-listed command silently auto-allows when it appears after |.

Reproduction

Permissions:

{
  "permissions": {
    "allow": ["Bash(cat:*)", "Bash(sort:*)", "Bash(head:*)", "Bash(echo:*)"],
    "ask": ["Bash(pandoc:*)", "Bash(curl:*)"]
  }
}

Auto-allowed (bug — ask rule on pipe target skipped):

cat <<'EOF' | pandoc --to=plain # heredoc first arg ✗

This issue was previously verified as reproducing on v2.1.104 by @spawnia in #48518, but the issue was locked by a bot before it could be reopened.

View original on GitHub ↗

8 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/48518
  2. https://github.com/anthropics/claude-code/issues/56019
  3. https://github.com/anthropics/claude-code/issues/42426

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Tarek98 · 5 months ago

This is not a duplicate, the other issues have been falsely marked as duplicated and this needs to be addressed!

Tarek98 · 5 months ago

@ashwin-ant

spawnia · 4 months ago

Thank you @Tarek98! My repeated reproduction in https://github.com/anthropics/claude-code/issues/48518#issuecomment-4287842491 was apparently overlooked or not tended to quickly enough. I hope someone from Anthropic can look into this soon and address this security bug. I am a bit skeptical of calling this a regression of https://github.com/anthropics/claude-code/issues/48518 - as far as I can tell, this issue always existed and was never implemented correctly or fixed.

Tarek98 · 4 months ago

Thanks @spawnia, I changed the title to say your issue was still not fixed instead of calling it a regression. I was too quick to generate this issue and hadn't noticed that title naming mistake, so sorry about that. Hoping someone from Anthropic can take a look soon too.

github-actions[bot] · 3 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

spawnia · 3 months ago

Tested on v2.1.193 (Linux/WSL2 Ubuntu 24.04).

With cat:* in allow and pandoc:* in ask, running:

cat <<'EOF' | pandoc --to=plain
hello world
EOF

Claude Code required user approval before proceeding — the ask rule on pandoc fired correctly. The command did not auto-allow silently.

This suggests the bypass is fixed as of v2.1.193. Leaving this note here since the issue was closed for inactivity before the fix could be confirmed.

github-actions[bot] · 1 month ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.