-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"## The lab/ directory does not exist\n\n`git ls-files` on the repository returns two paths:\n\n```text\nCVE-2026-40072.docx\nREADME.md\n```\n\nThe README's \"Repository Structure\" section lists:\n\n```text\n.\n├── requirements.txt\n├── lab/\n│ ├── fake_internal_server.py\n│ ├── ssrf_demo.py\n│ └── ssrf_fixed_check.py\n├── docs/\n│ └── blog-post-outline.md\n└── screenshots/\n```\n\nFive 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.\n\nThe 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.\n\nThe 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.\n\n## The script the document calls a PoC is `requests.get`\n\nThe 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/`.\n\nThe first script, the document's `fake_internal_server.py`:\n\n```python\nfrom flask import Flask, request\napp = Flask(__name__)\n@app.route('/', defaults={'path': ''})\n@app.route('/')\ndef catch_all(path):\n print(f\"[!] SSRF HIT! Path: /{path} | From: {request.remote_addr}\")\n return '{\"secret\": \"AWS_KEY=AKIAIOSFODNN7EXAMPLE\"}', 200\napp.run(host=\"127.0.0.1\", port=9999)\n```\n\nA 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.\n\nThe second script, the document's `ssrf_demo.py`, in full:\n\n```python\nimport requests\nmalicious_url = \"http://127.0.0.1:9999/latest/meta-data/iam/credentials\"\nproxies = {\"http\": \"http://127.0.0.1:8080\"}\nprint(f\"[*] Simulating web3.py CCIP Read SSRF fetch to: {malicious_url}\")\nresponse = requests.get(malicious_url, proxies=proxies)\nprint(f\"[!] Response: {response.text}\")\n```\n\nFive 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.\n\nThe 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.\n\n## The bug the script does not exercise\n\nCVE-2026-40072 is an SSRF in web3.py's CCIP Read implementation. The advisory ([GHSA-5hr4-253g-cpx2](https://github.com/advisories/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`.\n\nThe 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.\n\nThe patch is [`b1c57bb`](https://github.com/ethereum/web3.py/commit/b1c57bb0a124359c9902daaefab4d8af7c3c4c1e). 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.\n\n## The fix the document describes is not the fix web3.py shipped\n\nSection 7 of the Word document, titled \"Official Fix and Verification,\" opens with:\n\n> 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.\n\nThe 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:\n\n```bash\npython3 -c \"from web3 import Web3; w3 = Web3(); \\\n print('CCIP Read enabled:', w3.provider.global_ccip_read_enabled)\"\n```\n\nand 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.\n\nThe 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.\n\n## The pattern, in its cleanest form\n\nThis 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](/posts/credssp-cve-2025-47987-poc-documents-a-different-project), and in the `Zvckster/CVE-2025-63353` README covered in [FiberHome's HG6145F1 default PSK](/posts/fiberhome-hg6145f1-psk-is-the-ssid-inverted). 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.\n\nThe 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](/posts/cve-2026-46300-fragnesia-placeholders-stop-at-verify-write-denied) 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.\n\nThe 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.\n\n## What the scanner saw\n\nA 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.\n\nThe 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`.\n\nPoC: [u1tr0nex/cve-2026-40072-ssrf-lab](https://github.com/u1tr0nex/cve-2026-40072-ssrf-lab)","closing_line":"The CVE is in web3.py. The Python in the repository never imports web3.py.","hook_md":"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.","post_id":560,"slug":"web3py-cve-2026-40072-poc-never-imports-web3py","title":"CVE-2026-40072: The web3.py SSRF PoC Never Imports web3.py","type":"initial","unreadable_sentence":"The CVE is in web3.py. The Python in the repository never imports web3.py."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCaqmGYAAKCRDeZjl4jgkQ JhMWAP9zviySbKO8rw7JYwQM0WI5SljT4wcgDoQ8beIqgFvanwD7BuiIgmSQzd9i beiYBaIT5rgwWCxwd0KUegasZVpddgE= =6Mfp -----END PGP SIGNATURE-----