CVE-2026-40072: web3.py SSRF Vulnerability via CCIP Read OffchainLookup URL Handling
Summary
CVE-2026-40072: web3.py: SSRF via CCIP Read (EIP-3668) OffchainLookup URL handling. Affects web3 across 2 version ranges.
>= 6.0.0b3, < 7.15.0
>= 8.0.0b1, < 8.0.0b2
Fixed in 7.15.0 or 8.0.0b2, depending on the release line you run. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
web3.py is a widely-used Python library that facilitates interaction with Ethereum blockchain and smart contracts. It provides various functionalities, including sending transactions, querying blockchain data, and executing smart contract methods. The library's implementation of CCIP Read (EIP-3668) allows smart contracts to specify URLs for off-chain data retrieval. However, this feature has a significant security flaw that exposes applications to Server-Side Request Forgery (SSRF) attacks.
Vulnerability Detail
The vulnerability arises from the way web3.py handles URLs supplied by smart contracts in the offchain_lookup_payload. The library directly uses these URLs for HTTP requests without validating their destinations. This lack of validation allows a malicious contract to force the web3.py process to issue requests to arbitrary destinations, including internal network services and cloud metadata endpoints. The SSRF risk is exacerbated by the default-on nature of CCIP Read, meaning any application using web3.py's call method is exposed unless explicitly disabled. The vulnerability can lead to unauthorized access to sensitive internal services and data.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
>= 6.0.0b3, < 7.15.07.15.0pip install --upgrade "web3==7.15.0" -
>= 8.0.0b1, < 8.0.0b28.0.0b2pip install --upgrade "web3==8.0.0b2"
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a temporary workaround, you can disable CCIP Read by setting the global_ccip_read_enabled flag to False in your application: global_ccip_read_enabled = False. This will prevent the automatic invocation of the CCIP Read feature, reducing the risk of SSRF attacks.
Conclusion
The web3.py library has a critical SSRF vulnerability due to improper handling of URLs in the CCIP Read feature. It is essential to update to the patched versions to mitigate the risk and implement additional security measures to protect against potential exploitation.
See every vulnerability recorded for web3 →
FAQ
Server-Side Request Forgery (SSRF) is a security vulnerability that allows an attacker to send crafted requests from a vulnerable server to internal or external resources, potentially leading to unauthorized access to sensitive data.
You can check if your application is affected by using the Vulert playground at Vulert Scanner. This tool allows you to monitor and alert for open-source vulnerabilities without requiring any installation.
The risks include unauthorized access to internal services, exposure of sensitive data, and potential exploitation of internal APIs, which can lead to further security breaches.
Yes, you can mitigate the risk by disabling the CCIP Read feature in your application, but updating to the patched version is the recommended solution.
The CVSS score of this vulnerability is 7.2, indicating a high severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for web3.