Time-of-check Time-of-use (TOCTOU) Race Condition Affecting anthropic package, versions [0.86.0,0.87.0)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.14% (4th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Time-of-check Time-of-use (TOCTOU) Race Condition vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-ANTHROPIC-15907872
  • published5 Apr 2026
  • disclosed1 Apr 2026
  • creditUnknown

Introduced: 1 Apr 2026

CVE-2026-34452  (opens in a new tab)
CWE-367  (opens in a new tab)
CWE-59  (opens in a new tab)

How to fix?

Upgrade anthropic to version 0.87.0 or higher.

Overview

anthropic is a The official Python library for the anthropic API

Affected versions of this package are vulnerable to Time-of-check Time-of-use (TOCTOU) Race Condition via the _validate_path function in the _beta_builtin_memory_tool.py‎ file. An attacker can access files outside the intended sandbox directory by exploiting a race condition between path validation and file operation, allowing reads or writes to escape the sandbox. This is only exploitable if a local attacker is able to write to the memory directory.

CVSS Base Scores

version 4.0
version 3.1