Critical Malicious Code Vulnerability in anthropic-sdk Package

anthropic-sdk Updated 05 Oct 2026

Summary

04/10/2026
CRITICAL
No i
Critical
Not published

MAL-2026-17472: Malicious code in anthropic-sdk (PyPI). Affects anthropic-sdk versions 0.1.0. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The anthropic-sdk package, available on PyPI, is designed to provide a simplified interface for interacting with the official Anthropic client. It aims to facilitate developers' integration with Anthropic's services by re-exporting symbols from the official client. However, the package has been found to contain malicious code that compromises user security and privacy.

Vulnerability Detail

The vulnerability originates from the package's design, which includes a boot routine that executes upon import. This routine increments a usage counter and, after the third import, fetches a remote script from an unverified GitHub repository. The fetched script is then cached, compiled, and executed, allowing for arbitrary code execution on the user's machine. This poses significant risks, including unauthorized access to sensitive information such as credentials, environment variables, and SSH keys. The malicious code also includes mechanisms to evade detection in sandbox environments.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

pip uninstall anthropic-sdk

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

There are no effective workarounds for this vulnerability other than removing the package entirely. If you need to maintain functionality, switch to the official Anthropic client and avoid using the compromised package.

Conclusion

The anthropic-sdk package contains a critical vulnerability that allows for malicious code execution, posing significant risks to users. It is imperative to uninstall the package and consider using the official Anthropic client to ensure the security of your applications.

See every vulnerability recorded for anthropic-sdk →

Share this vulnerability

FAQ

The anthropic-sdk package is a Python library that provides a simplified interface for developers to interact with the Anthropic API.

The vulnerability allows for arbitrary code execution, which can lead to unauthorized access to sensitive data and potential system compromise.

No, there is currently no patched version of the anthropic-sdk package available. It is recommended to uninstall the package immediately.

You can use tools like Vulert, which monitors and alerts for open-source vulnerabilities in your software by analyzing the Pipfile.lock. You can check your application for vulnerabilities using the Vulert playground without any signup.

If you have used the anthropic-sdk package, it is crucial to uninstall it and review your system for any unauthorized changes or data breaches.

Related vulnerabilities

Recent vulnerabilities recorded for anthropic-sdk.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

pip uninstall anthropic-sdk

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback