//nefariousplan

CVE-2026-40072: The web3.py SSRF PoC Never Imports web3.py

vendor

patterns

cve

proof of concept

The README for u1tr0nex/cve-2026-40072-ssrf-lab opens with a directory tree. lab/ holds three Python files. docs/ holds an outline. screenshots/ holds the screenshots. requirements.txt pins the dependencies. The repository on disk contains two files: that README, and a Word document. The lab directory does not exist; neither does docs, neither does screenshots, neither does the requirements file. The scanner that polled GitHub for repositories named CVE-2026-40072 read the README and registered "PoC available." The PoC is in the document, in prose. The Python script the document calls a PoC never imports web3.py.

The lab/ directory does not exist

git ls-files on the repository returns two paths:

CVE-2026-40072.docx
README.md

The README's "Repository Structure" section lists:

.
├── requirements.txt
├── lab/
│   ├── fake_internal_server.py
│   ├── ssrf_demo.py
│   └── ssrf_fixed_check.py
├── docs/
│   └── blog-post-outline.md
└── screenshots/

Five files, three directories, none of which are on disk. The "Running the Lab" section that follows gives the reader paths to invoke: python3 lab/fake_internal_server.py, python3 lab/ssrf_demo.py, python3 lab/ssrf_fixed_check.py. None of those paths resolve. The "Setup" section opens with pip install -r requirements.txt. The repository does not contain a requirements.txt.

The repository's four-commit history records the seam. The first commit added the CVE-2026-40072.docx and a 466-line README. The 466-line README is a separately-titled internship deliverable, "Footprinting and Reconnaissance Report, OWASP Juice Shop," with table of contents, a screenshots/01_search_engine/ listing, and conclusions about Heroku's reverse proxy hiding the target IP. The second commit, 68 seconds later, deleted that README. The third commit, two minutes after that, added the current 135-line README describing the lab directory that does not exist. The fourth commit, 48 seconds after that, trimmed 22 lines.

The entire repository history fits in four minutes. The first three minutes are an upload mistake and its cleanup. The fourth minute is the README that the scanner read.

The script the document calls a PoC is requests.get

The Word document, the one file in the repository that contains something other than a description of a project that does not exist, is a lab-report-shaped blog post titled "CVE-2026-40072 Lab Blog Post." The author byline names a "Technical Research & Cyber Security Operations Intern" at GreySentinel; the byline date is June 2026, the day the repository was published. The document has ten numbered sections. Section 6 is titled "Proof of Concept, SSRF Demonstration." Section 6 contains the two scripts the README claims live under lab/.

The first script, the document's fake_internal_server.py:

from flask import Flask, request
app = Flask(__name__)
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def catch_all(path):
    print(f"[!] SSRF HIT! Path: /{path} | From: {request.remote_addr}")
    return '{"secret": "AWS_KEY=AKIAIOSFODNN7EXAMPLE"}', 200
app.run(host="127.0.0.1", port=9999)

A catch-all Flask app on localhost port 9999 that returns the constant string {"secret": "AWS_KEY=AKIAIOSFODNN7EXAMPLE"}. The hardcoded key is the canonical example value Amazon ships in its own AWS documentation; the demonstrator wrote the credential to be leaked into the response of the demonstrator's own server.

The second script, the document's ssrf_demo.py, in full:

import requests
malicious_url = "http://127.0.0.1:9999/latest/meta-data/iam/credentials"
proxies = {"http": "http://127.0.0.1:8080"}
print(f"[*] Simulating web3.py CCIP Read SSRF fetch to: {malicious_url}")
response = requests.get(malicious_url, proxies=proxies)
print(f"[!] Response: {response.text}")

Five lines. One import requests. One hardcoded URL pointing at the Flask catch-all the previous script started. One Burp proxy. One requests.get. The print statement names the operation: Simulating web3.py CCIP Read SSRF fetch to. The script does not import web3.py. The script does not deploy a smart contract. The script does not trigger an OffchainLookup revert. The script does not call any function in any module that the CVE-2026-40072 advisory names.

The script is requests.get, proxied through Burp, hitting a Flask app that returns a constant. The CVE the repository is named after is in web3.py's processing of attacker-controlled OffchainLookup URLs. The script's own print calls itself a simulation. The print is correct.

The bug the script does not exercise

CVE-2026-40072 is an SSRF in web3.py's CCIP Read implementation. The advisory (GHSA-5hr4-253g-cpx2) names two source files: web3/utils/exception_handling.py and web3/utils/async_exception_handling.py. EIP-3668 defines a flow where a smart contract reverts with an OffchainLookup(address sender, string[] urls, bytes callData, bytes4 callbackFunction, bytes extraData) error. The library calling .call() is supposed to detect the revert, fetch the URLs the contract supplied, and re-invoke the contract with the fetched data. web3.py's implementation, in the two named files, fetched the contract-supplied URLs without filtering. The pre-patch implementation enabled this behavior by default; global_ccip_read_enabled on every provider initialized to True.

The exploit primitive the advisory describes is therefore: an attacker deploys a contract that reverts with OffchainLookup URLs pointing at the calling backend's link-local interfaces. Cloud IMDS endpoints (http://169.254.169.254/latest/meta-data/iam/security-credentials/) are the canonical target. Backend services that accept user-supplied contract addresses and call .call() against them fetch the IMDS response back through a web3.py callback path, where the response bytes become the second-call payload the attacker-controlled contract receives.

The patch is b1c57bb. It adds a new file, web3/utils/ccip_url_validation.py, exposing validate_ccip_url_scheme() and validate_ccip_url_host(). The scheme validator enforces HTTPS by default and gates HTTP behind a new provider flag, ccip_read_allow_http. The host validator resolves the hostname and rejects private and reserved CIDRs (loopback, link-local, RFC1918). The patch sets allow_redirects=False on the underlying request. The patch exposes a ccip_read_url_validator hook for callers that want to apply a custom allowlist. The patch does not change global_ccip_read_enabled's default.

The fix the document describes is not the fix web3.py shipped

Section 7 of the Word document, titled "Official Fix and Verification," opens with:

The vulnerability was officially patched in web3.py v7.15.0. The fix changes the default value of global_ccip_read_enabled to False, meaning CCIP Read is now opt-in rather than opt-out.

The patch is in the commit linked from the document's own References section. The patch does the thing the document does not describe (URL validation in a new file), and does not do the thing the document describes (flipping a default). Section 7.3 instructs the reader to verify the fix by running:

python3 -c "from web3 import Web3; w3 = Web3(); \
  print('CCIP Read enabled:', w3.provider.global_ccip_read_enabled)"

and confirming the value is False. On v7.15.0, the value is still True. The verification step the document tells the reader to perform produces the opposite of the document's expected result.

The script the document calls a PoC does not exercise the bug. The fix the document tells the reader to verify is not the fix the patch implements. The Burp HTTP History tab the document tells the reader to check after upgrading web3.py will show no request, because the script never made a web3.py request before the upgrade and continues not to make one after the upgrade. The "before" and "after" of the document are the same requests.get with the same Burp proxy. The document treats them as a comparison.

The pattern, in its cleanest form

This repository is Phantom Project Documentation. The README's directory tree, the "Running the Lab" commands, the pip install -r requirements.txt opener, all describe a project the directory listing does not contain. The seam between what the documentation describes and what the disk contains is one git ls-files. The same shape recurred in the kaleth4/CredSSP repository covered in the CVE-2025-47987 CredSSP PoC that documents a project that does not exist, and in the Zvckster/CVE-2025-63353 README covered in FiberHome's HG6145F1 default PSK. In each case a scanner that indexes GitHub by repository name read the documentation, registered "PoC available," and indexed an artifact whose surrounding documentation describes a project that is not in the repository.

The script inside the document is also a Placeholder PoC. The CredSSP exhibit's Exploit.c is structurally complete and reaches the documented exploit primitive because it is a refactor of someone else's working PoC; the placeholder there is around the script. The Fragnesia PoCs for CVE-2026-46300 ship a 117-line REPL that calls unshare(CLONE_NEWUSER) and stops at a state the real exploit's source code explicitly labels verify_write_denied. The CVE-2026-40072 script in this document is a sharper version of the same shape: it never enters the vulnerable code path at all. The bug is in web3.py's CCIP Read handling. The script does not import web3.py. The placeholder is the import statement.

The intern shape sits over both. The author's previous commit on this repository, before the four-minute reshuffling, was the 466-line "Footprinting and Reconnaissance Report, OWASP Juice Shop," a separately-titled deliverable for a different module of the same internship at GreySentinel. The CVE-2026-40072 lab report's structure mirrors that earlier report's structure: numbered table of contents, organization byline, per-section reference list, a "Mitigation Recommendations" close. CVE-2026-40072 was assigned by GitHub on 2026-04-09, two months before the intern picked it up as the next deliverable. The document's existence is sincere. The repository's claim that it ships a working lab is not.

What the scanner saw

A repository named cve-2026-40072-ssrf-lab with a README that describes a Python project, on a CVE that landed two months prior, with a fake AWS key visible in the README's example output. Every signal the scanner reads from outside the repository tells it that a PoC exists at this URL. The signals the scanner does not read, git ls-files, the absence of any .py file, the absence of an import web3 statement anywhere in the artifact the repository does contain, are the ones that would tell it otherwise.

The scanner is not at fault. The scanner reads what GitHub exposes. GitHub exposes the README. The README describes a project. The project is in the document. The document calls itself a Proof of Concept, in section 6, and the script in section 6 is requests.get.

PoC: u1tr0nex/cve-2026-40072-ssrf-lab

The CVE is in web3.py. The Python in the repository never imports web3.py.