claude-code - 💡(How to fix) Fix [BUG] `awk -f script.awk` that can execute arbitrary code may skip the classifier's audit in auto-mode [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52667Fetched 2026-04-24 10:42:57
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1renamed ×1

Error Message

Error Messages/Logs

Code Example

BEGIN {
    system("bash -c '...")
}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

In auto-mode, commands that may execute arbitrary code, such as bash and python, are forced to be audited by the security classifier, regardless of whether they are on the user-defined allow-list. awk -f script.awk can do the same things that bash does (executing arbitrary code) if script.awk contains:

BEGIN {
    system("bash -c '...")
}

However, awk isn't forced to go through the classifier's audit, so if it is on the user-defined allow-list, it will skip the security audit entirely in auto-mode. Compared to bash, this doesn't make sense.

What Should Happen?

awk should be forced to go through the classifier's audit.

Error Messages/Logs

N/A

Steps to Reproduce

Create a file script.awk containing the aforementioned content. Add awk to the user-defined allow-list. Launch Claude Code in auto-mode and ask it to finish a task that requires executing awk -f script.awk.

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.119

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Windows Terminal

Additional Information

No response

extent analysis

TL;DR

The issue can be addressed by modifying the security classifier to force awk commands to undergo audit, similar to bash and python, when in auto-mode.

Guidance

  • Review the current implementation of the security classifier to understand how it handles awk commands and identify why they are not being audited.
  • Update the classifier's logic to include awk in the list of commands that require auditing, especially when they are used with the -f option to execute scripts.
  • Test the updated classifier with the provided script.awk example to ensure it correctly forces the audit.
  • Consider adding awk to the default list of commands that are subject to auditing in auto-mode, to prevent similar bypasses.

Example

No code snippet is provided as the issue does not specify the programming language or framework used for the security classifier.

Notes

The solution assumes that the security classifier's logic can be modified to include awk commands. If the classifier is a third-party component, it may be necessary to consult its documentation or contact its developers for guidance.

Recommendation

Apply workaround: Modify the security classifier to force awk commands to undergo audit, as this directly addresses the identified issue and prevents potential security bypasses.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] `awk -f script.awk` that can execute arbitrary code may skip the classifier's audit in auto-mode [1 comments, 2 participants]