16 detected by the audit

At a glance

Critical 9  High 11  Medium 8

Severity reflects how directly a misconfiguration leads to credential theft, loss of production data or a supply-chain compromise. Audit check gives the Claude Code Security Audit checks that detect it; "manual" means review it by hand.

The misconfigurations

M1CriticalAudit check: R01, U13

Running --dangerously-skip-permissions on a laptop, or through a shell alias.

Why it matters. Bypass mode skips every permission prompt and path check, so any injected instruction runs unchecked.

Fix. Remove the alias. Set permissions.disableBypassPermissionsMode: "disable" in managed settings. Use bypass only in a disposable, network-restricted container.

M2CriticalAudit check: U06, U07, U15, P08

Production credentials within the agent's reach: .env files, cloud CLI credentials, database URLs, API tokens in unrelated files.

Why it matters. A Cursor agent found a Railway API token in an unrelated file and deleted a production database and its volume backups in about 9 seconds (PocketOS, via Cerbos).

Fix. Deny or mask credential files and variables in sandbox.credentials; add Read(./.env) deny rules; use separate development credentials; reach production only through break-glass access.

M3CriticalAudit check: U02, U03

Sandbox off, or on with allowUnsandboxedCommands left enabled.

Why it matters. Indirect prompt injection reached code execution under auto mode in 60 to 80% of trials; Anthropic describes auto mode as "a convenience feature backed by a best-effort classifier, not a security guarantee" (Embrace The Red).

Fix. Set sandbox.enabled: true, allowUnsandboxedCommands: false and, in managed settings, sandbox.failIfUnavailable: true. On Linux and WSL2, install bubblewrap and socat.

M4HighAudit check: U04, U05

A broad network allowlist: *, github.com, paste sites or webhook services.

Why it matters. Every allowed host is a possible exfiltration or command-and-control channel for an injected agent.

Fix. Allow only the registries and internal hosts you need; turn on strictAllowlist; organisations can set sandbox.network.allowManagedDomainsOnly.

M5HighAudit check: U08, U10

No deny or ask rules for destructive and publishing commands.

Why it matters. Claude Code ran terraform destroy against a stale state file and deleted a production database and its automated snapshots; recovery depended on AWS support (DataTalks.Club).

Fix. Ask before git push, terraform, kubectl, npm publish and migrations; deny rm -rf and force-push.

M6HighAudit check: U09, P02

Over-broad allow rules (Bash(*), Bash(sudo *), WebFetch) in user or project settings.

Why it matters. An allow rule turns any successful prompt injection straight into execution without a prompt.

Fix. Allow only specific safe commands. Organisations can set allowManagedPermissionRulesOnly.

M7CriticalAudit check: manual

Opening untrusted repositories on a host that holds your credentials.

Why it matters. Repository files have repeatedly been able to run code: CVE-2025-59536 (project config executed before the trust prompt), and the Miasma worm's SessionStart hook.

Fix. Open unknown code, forks and contractor repositories only in a dev container, VM or cloud session with no credentials.

M8HighAudit check: I01

Claude Code not updated, and no minimum version enforced.

Why it matters. The Claude Code repository lists 30 CVE advisories published since June 2025 (GitHub security advisories).

Fix. Update weekly and within days of an advisory. Organisations can set requiredMinimumVersion in managed settings.

M9HighAudit check: P02, P03, P09, P10

Project .claude/settings.json or .mcp.json with hooks, MCP servers or allow rules committed without review.

Why it matters. Configuration committed to a repository is how the Miasma worm reached Claude Code users (StepSecurity).

Fix. Put CLAUDE.md, .claude/** and .mcp.json under CODEOWNERS; organisations can set allowManagedHooksOnly and allowManagedMcpServersOnly.

M10HighAudit check: M01, P04, P05, U11

Unvetted MCP servers, unpinned versions, broad OAuth scopes, or enableAllProjectMcpServers: true.

Why it matters. In a proof of concept, an injected support ticket made a Cursor agent with Supabase service_role access copy secret tokens into the ticket thread (General Analysis).

Fix. Keep an approved MCP list; review scopes; pin versions; re-review on every update.

M11MediumAudit check: U17, P13

Plugins installed from unknown marketplaces, or sideloaded with CLI flags.

Why it matters. Plugins can bundle hooks, MCP servers and executables that run with your privileges.

Fix. Organisations can set strictKnownMarketplaces, disableSideloadFlags and disableCommandPluginSources, and run a private marketplace.

M12CriticalAudit check: manual

Untrusted issue or pull request text placed in CI agent prompts; the action not pinned by SHA; allowed_non_write_users: "*".

Why it matters. PR titles and comments hijacked the Claude Code Security Review action into leaking CI secrets (Comment and Control); the same pattern hit several AI actions (PromptPwnd, Aikido); claude-code-action trusted any actor ending in [bot], fixed in v1.0.94 (CSA research note).

Fix. Pin actions by SHA; keep actor checks; pass untrusted text as clearly delimited data; give review jobs read-only tokens.

M13CriticalAudit check: manual

The CI job that runs the agent also holds publishing or deploy credentials (NPM_TOKEN, deploy keys, id-token: write).

Why it matters. An issue title injected into Cline's triage workflow, which ran claude-code-action, led to stolen release tokens and a malicious cline@2.3.0 publish (Adnan Khan, Clinejection).

Fix. Split the agent job from the privileged job; publish with OIDC trusted publishing in the privileged job only; require environment approvals.

M14HighAudit check: manual

Headless (claude -p) or Agent SDK runs on shared hosts with ambient credentials.

Why it matters. The docs state: "Trust verification is disabled when running non-interactively with the -p flag" (Claude Code security docs).

Fix. One container per run: non-root, read-only root, an egress allowlist, explicit --allowedTools, and no ambient cloud credentials.

M15MediumAudit check: manual

Auto mode treated as a safety boundary.

Why it matters. A shadowed standard-library module (struct.py) got past the auto mode classifier in 3 of 5 runs (Embrace The Red).

Fix. Keep the sandbox and deny rules under auto mode; disable auto mode for regulated repositories.

M16HighAudit check: manual

Backups and snapshots in the same account and blast radius as production.

Why it matters. The DataTalks.Club deletion removed the automated snapshots along with the database (DataTalks.Club).

Fix. Cross-account or immutable backups, deletion protection and point-in-time recovery.

M17MediumAudit check: manual

Personal or consumer accounts used for company code; no SSO.

Why it matters. Consumer accounts sit outside company data terms, audit logs and managed policy.

Fix. Organisations can set forceLoginMethod and forceLoginOrgUUID, use SSO and SCIM, and block consumer endpoints at the proxy.

M18MediumAudit check: manual

No telemetry, or telemetry developers can turn off.

Why it matters. Without telemetry, incidents are found by the victims, not by defenders.

Fix. Set the OpenTelemetry variables (CLAUDE_CODE_ENABLE_TELEMETRY, exporters, endpoint) in the managed env block so they cannot be overridden.

M19MediumAudit check: manual

IDE extensions out of date, local listeners exposed, or the WebDAV service running on Windows.

Why it matters. CVE-2025-52882: older Claude Code IDE extensions ran an unauthenticated local WebSocket server any website could connect to, fixed in 1.0.24 (Datadog Security Labs); the docs recommend against enabling WebDAV or allowing \\* paths (security docs).

Fix. Update IDE extensions with the CLI; disable the WebClient service; never allow \\* paths.

M20MediumAudit check: P06, P07

No scope or stop conditions in CLAUDE.md; the agent is free to "find a way".

Why it matters. An agent told only to finish a task will use whatever it can reach, as the PocketOS and DataTalks.Club deletions show.

Fix. State in-scope systems, forbidden actions and "stop and ask" conditions in CLAUDE.md; gate automation triggers behind labels.

M21HighAudit check: manual

The agent's identity can push to any branch or open pull requests visible outside the team.

Why it matters. Anything the agent can push is visible to others before a person reviews it, and pushes can carry data out of the environment.

Fix. Branch rulesets that limit the agent to its own branch prefix; review before merge or public visibility; push-time secret scanning; Bash(git push *) under ask.

M22HighAudit check: M02, P12

MCP servers that read content outsiders can write (error monitoring, tickets, chat, email) connected to an agent that can run commands.

Why it matters. Fake Sentry error events carrying "fix" instructions hijacked Claude Code, Cursor and Codex through an MCP server (Agentjacking, The Hacker News).

Fix. Read-only scopes; keep the sandbox and ask rules on while such a server is connected; never pair it with -p or auto mode.

M23CriticalAudit check: manual

One credential spans staging and production; no short-lived, task-scoped agent identity.

Why it matters. The PocketOS agent was working on a staging task when it used a token that could delete production (Cerbos).

Fix. Separate accounts and tokens per environment; short-lived credentials minted per task; production only through break-glass access.

M24CriticalAudit check: P03, P09

Project SessionStart and other hooks allowed to run when a repository is opened.

Why it matters. The Miasma worm's Claude Code trigger was a SessionStart hook in .claude/settings.json (StepSecurity).

Fix. Read .claude/settings.json before opening; open unknown repositories in containers; organisations can set allowManagedHooksOnly.

M25CriticalAudit check: P10, U11

Folder trust treated as a harmless click.

Why it matters. Accepting the trust prompt starts the project's MCP servers as native processes with your privileges, outside the sandbox; Anthropic treats the prompt as your consent (Adversa AI, TrustFall).

Fix. Never trust a folder before reading .mcp.json and its settings; organisations can set allowManagedMcpServersOnly; run headless jobs only in per-job containers.

M26MediumAudit check: U17, P13, I01

Plugin auto-update on, with plugins pinned to marketplaces on git hosts outside GitHub.

Why it matters. A branch named like a pinned plugin commit could silently replace the plugin on auto-update; fixed in Claude Code 2.1.179 (AIR Security, Plugin4Shell).

Fix. Update to 2.1.179 or later; use marketplaces you control; review the auto-update setting.

M27HighAudit check: H02, P11

Approval prompts relied on to show what a file edit really changes.

Why it matters. A symlink with a harmless name made the prompt show a decoy path while the write hit agent configuration (Adversa AI, SymJack); Wiz showed a related gap (GhostApproval).

Fix. A PreToolUse hook that resolves symlinks and blocks writes outside the project and to dotfiles, whatever path is displayed; sandbox filesystem limits.

M28MediumAudit check: manual

Skill review that ends at a static scanner.

Why it matters. Obfuscated skills evaded static skill scanners in over 90% of attempts (Adversa AI, SkillCloak).

Fix. Allow skills only from known sources, and watch what they do at run time with hooks and telemetry; treat scanners as one layer.

Fix order

Work through them in this sequence, finishing each step before starting the next:

  1. Stop the worst exposure: M1, M2, M7, M8. End bypass mode, move credentials out of reach, isolate untrusted code, update everything.
  2. Contain the agent: M3, M4, M5, M6, M12, M13, M24, M25. Sandbox on with a narrow allowlist, ask and deny rules, harden every CI workflow that runs an agent, stop repository hooks and MCP servers running on open.
  3. Govern and monitor: M9, M10, M11, M14, M16, M17, M18, M22, M23. Govern configuration and extensions, isolate headless runs, move backups out of the blast radius, identity and telemetry.
  4. Close the rest: M15, M19, M20, M21, M26, M27, M28. The remaining items, then re-run the audit against your new baseline.

One managed-settings file

For organisations, this example managed-settings file enforces the settings behind M1, M3, M4, M6, M8, M9, M10, M11, M17 and M18 on Claude Code versions that support each key. Replace the placeholders, and check every key against the settings reference for your Claude Code version before rolling it out. Settings marked managed-only there have no effect in a user's own settings file.

{
  "allowManagedPermissionRulesOnly": true,
  "permissions": {
    "disableBypassPermissionsMode": "disable",
    "deny": [
      "Read(./.env)", "Read(./.env.*)", "Read(~/.ssh/**)", "Read(~/.aws/**)",
      "Bash(curl *)", "Bash(wget *)", "Bash(rm -rf *)", "Bash(git push --force *)"
    ],
    "ask": [
      "Bash(git push *)", "Bash(terraform *)", "Bash(kubectl *)",
      "Bash(npm publish *)", "Bash(prisma migrate *)"
    ]
  },
  "sandbox": {
    "enabled": true,
    "failIfUnavailable": true,
    "allowUnsandboxedCommands": false,
    "filesystem": { "allowManagedReadPathsOnly": true },
    "network": {
      "allowManagedDomainsOnly": true,
      "allowedDomains": ["registry.npmjs.org", "pypi.org", "artifacts.corp.example.com"]
    },
    "credentials": {
      "files": [
        { "path": "~/.aws", "mode": "deny" },
        { "path": "~/.ssh", "mode": "deny" }
      ]
    }
  },
  "allowManagedMcpServersOnly": true,
  "allowManagedHooksOnly": true,
  "disableSideloadFlags": true,
  "disableCommandPluginSources": true,
  "requiredMinimumVersion": "<approved version>",
  "forceLoginMethod": "claudeai",
  "forceLoginOrgUUID": "<your org uuid>",
  "env": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
    "OTEL_METRICS_EXPORTER": "otlp",
    "OTEL_LOGS_EXPORTER": "otlp",
    "OTEL_EXPORTER_OTLP_ENDPOINT": "https://otel.corp.example.com"
  }
}

Sources

Informational only, with no guarantee of a vulnerability-free setup, so test every configuration in your own environment. AISecurityLabs.org is independent and not affiliated with Anthropic.