Skip to content
Beta
All articles

Claude Code 2.1.321: the security fixes behind the Fable 5.2 release

Claude Code 2.1.321 fixed an MCP OAuth token leak on redirect and several permission and sandbox gaps. What changed and how to make sure everyone updates.

By The SpanDock team

5 min read

A diagram grouping the Claude Code 2.1.321 security fixes into three areas: MCP sign-in, Bash permissions and sandbox, and hooks and names

Claude Code 2.1.321 will be remembered as the release that made Claude Fable 5.2 the default Fable model. Its notes also contain a run of security fixes that are easy to scroll past. The release, published on 9 November 2026, fixed MCP sign-in requests that sent refresh tokens to another host on a redirect, a read-only Bash command that ran outside the sandbox without a prompt, and deny rules that missed files written by cp and mv. If your teams rely on Claude Code's permission rules or sandbox, version 2.1.321 or later is the floor to set.

What the release fixed

The release notes list each fix in one line, without advisories or severity ratings. The security-relevant ones fall into three groups.

MCP sign-in

  • "Fixed MCP OAuth requests sending secrets such as refresh tokens to another host when a server redirected them."

A refresh token lets its holder get new access tokens for a service, often for weeks. If an MCP server or anything between it and the client could redirect the request, the token could reach a host that was never meant to see it. We covered a related class of bug in the MCP TypeScript SDK. The notes don't say which redirects were affected or whether any known server exploited it.

Bash permissions and the sandbox

  • "Fixed a case where a read-only Bash command ran outside the sandbox without a permission prompt."
  • "Fixed a case where Bash permission checks judged a file write from the wrong folder and didn't prompt."
  • "Fixed deny rules and protected-file prompts not applying to the file that a cp or mv into a directory writes."
  • "Fixed Bash commands sometimes running in the wrong folder when Claude sent several at once and an earlier one changed folders."

The common thread is that Claude Code's checks reason about what a command will do before it runs, and a few cases were reasoned about wrongly. Copying a file into a directory writes a file the command line never names; a check that looks only at the arguments misses it. A command checked as if run in one folder but executed in another can write somewhere a rule was meant to protect.

Hooks and names

  • "Fixed PreToolUse mcp_tool hooks on stdio and HTTP MCP servers being skipped when their answer was over 16 MiB; the tool call is now refused."
  • "Fixed a PreToolUse hook's ask being lost when another hook's defer finished first and could not be honored."
  • Files whose names hide text-direction or control characters are now refused when Claude sends them, and so are skill and command names with a letter some fonts draw as blank.

The first is the most important for organisations that enforce policy through hooks. A check that is skipped when its answer is large is a check an attacker can try to make large. The fix changes the failure from open to closed: the call is refused. The last two address names that look different to a person than they are, a known trick for hiding what a file or skill really is.

Analysis

None of these fixes came with an advisory, and the release notes don't rate them. That is consistent with how Claude Code has shipped fixes before, which we discussed in October's permission bypass fixes. It puts the work on the reader: you find out what changed by reading every line of every release.

The fixes also show where permission systems for agents are hardest. Static checks of shell commands are a model of what the shell will do, and the shell has ways to write files that the command line doesn't spell out, such as directory targets and folder changes earlier in a batch. The permissions documentation describes the rules; these fixes are a reminder that rules are only as good as the code that matches commands against them. Deny rules remain useful, but they are not a boundary on their own. Even the sandbox depends on which commands are sent into it, as the first fix in that group shows, so the operating system's own file permissions still matter.

The hook fix points the same way. Policy enforced by hooks is only reliable if the hook's failure modes are closed. An earlier release, covered in Claude Code hooks can now fail closed, added a setting for that; 2.1.321 closes one more path where a hook could be bypassed by size.

Making sure everyone updates

A fix helps only on computers that run it, and pinned installs and long-running sessions lag. The managed settings documentation describes requiredMinimumVersion, which an administrator can set centrally. It has two limits worth knowing: it takes effect at the next session start, and it "blocks an outdated binary from starting and doesn't end a session that's already running". A developer who leaves a session open for weeks keeps the old behaviour until they restart.

The changelog shows two further releases since, 2.1.322 and 2.1.323, so "2.1.321 or later" rather than "exactly 2.1.321" is the right policy.

What it means for engineering and security leaders

If your controls for Claude Code include deny rules, protected files, the sandbox or PreToolUse hooks, each had a gap that 2.1.321 closes. Treat versions before it as running with weaker enforcement than you configured. And because the fixes shipped without advisories, a process that waits for CVEs will not tell you to act.

Practical takeaways

  • Set requiredMinimumVersion to 2.1.321 or later in managed settings.
  • Ask developers to restart long-running sessions after the minimum changes; the setting does not end running ones.
  • Review MCP servers that use OAuth. If any redirect sign-in requests, consider rotating their refresh tokens after updating.
  • Check hooks that return large answers, and test that a failing hook refuses the call.
  • Don't rely on deny rules alone to protect sensitive paths; keep the sandbox and file permissions in place.
  • Read release notes for security fixes, not only advisories.

If you use SpanDock's guardrails, on the Enterprise plan, SpanDock installs a hook in Claude Code that checks the prompt and every tool call before it runs, and puts the hook back within a minute if a person removes it from their settings. It is a second check that doesn't depend on Claude Code's own permission rules.

Sources

  1. Claude Code release v2.1.321 (9 November 2026)
  2. Claude Code documentation: Changelog
  3. Claude Code documentation: Managed settings
  4. Claude Code documentation: Configure permissions
Cookie categories

Details: Cookie Policy.