Skip to main content
Vulnerability Database/CVE-2026-111171

CVE-2026-111171: Web3.py CCIP Read SSRF Vulnerability

CVE-2026-111171 is a server-side request forgery vulnerability in Web3.py that allows malicious contracts to bypass IP validation in CCIP Read URLs using IPv4-mapped IPv6 addresses. This article covers technical details, affected versions, potential impact, and recommended mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-111171 Overview

CVE-2026-111171 is a Server-Side Request Forgery (SSRF) vulnerability [CWE-918] in the Ethereum web3.py library. The flaw affects versions 7.15.0 through 7.16.0 and 8.0.0b2 through 8.0.0. The _check_ip_blocked() function does not unwrap IPv4-mapped IPv6 addresses when validating Cross-Chain Interoperability Protocol (CCIP) Read URLs. A malicious smart contract can return an OffchainLookup URL containing an IPv4-mapped IPv6 host or an AAAA DNS record. Clients with CCIP Read enabled then issue HTTP requests to loopback, private, or link-local services inside the trusted network boundary.

Critical Impact

Attackers controlling a malicious contract can coerce web3.py clients into probing internal services such as cloud metadata endpoints, administrative dashboards, and other RFC1918 hosts.

Affected Products

  • Ethereum web3.py versions 7.15.0 through 7.16.0
  • Ethereum web3.py versions 8.0.0b2 through 8.0.0
  • Downstream distribution: ApeWorX/web3.py (same advisory GHSA-5hr4-253g-cpx2)

Discovery Timeline

  • 2026-10-15 - CVE-2026-111171 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-111171

Vulnerability Analysis

CCIP Read (EIP-3668) allows an Ethereum smart contract to redirect a client to an off-chain HTTP endpoint for data resolution. The web3.py client fetches the URL returned by the contract's OffchainLookup revert and uses the response in on-chain verification. To prevent SSRF, web3.py validates the resolved host against a blocklist in web3/utils/ccip_url_validation.py.

The validation routine _check_ip_blocked() inspects a parsed IP address and rejects loopback, private, link-local, and reserved ranges. The function evaluates IPv4 and IPv6 addresses independently. It does not canonicalize IPv4-mapped IPv6 addresses of the form ::ffff:a.b.c.d back into their underlying IPv4 representation before applying the blocklist. As a result, an address such as ::ffff:127.0.0.1 or ::ffff:169.254.169.254 passes the IPv6 check while still routing to the mapped IPv4 destination at the socket layer.

Root Cause

The root cause is incomplete address normalization in the SSRF guard. Python's ipaddress module exposes an ipv4_mapped property that returns the embedded IPv4 address when present. The vulnerable implementation does not call this property or otherwise unwrap the mapping before evaluating is_private, is_loopback, is_link_local, or is_reserved. Any attribute lookup on the IPv6 object returns False for these ranges, since the IPv6 address itself falls outside IPv6 private space.

Attack Vector

Exploitation requires a client application that calls web3.py with CCIP Read enabled and a contract address controlled by the attacker. The attacker deploys a contract that reverts with OffchainLookup containing a URL whose host resolves to an IPv4-mapped IPv6 literal, or a hostname whose AAAA record points to such an address. The web3.py HTTP client issues a GET or POST request to the mapped destination from the host running the client. The response body is then returned to the contract for on-chain callback processing, enabling data exfiltration from internal services. Refer to the GitHub Security Advisory GHSA-5hr4-253g-cpx2 and the vulnerable validation code for exact source references.

Detection Methods for CVE-2026-111171

Indicators of Compromise

  • Outbound HTTP requests from web3.py client hosts to loopback (127.0.0.0/8), private (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), link-local (169.254.0.0/16), or cloud metadata (169.254.169.254) destinations
  • DNS queries from client hosts returning AAAA records with the ::ffff: prefix followed by RFC1918 or loopback octets
  • Application logs showing OffchainLookup reverts with URLs containing bracketed IPv6 literals of the form [::ffff:x.x.x.x]

Detection Strategies

  • Inspect egress proxy logs for CCIP Read requests whose Host header or SNI resolves to IPv4-mapped IPv6 destinations
  • Correlate smart contract call traces with the destination IP of subsequent HTTP fetches issued by web3.py worker processes
  • Alert on any process importing the web3 module making connections to 169.254.169.254 or other internal management addresses

Monitoring Recommendations

  • Enable verbose logging of web3.utils.ccip_url_validation and capture the parsed host for every CCIP Read invocation
  • Restrict egress from backend wallets and indexers to a documented allowlist of CCIP gateways and monitor rejections
  • Monitor cloud instance metadata service (IMDS) access logs for requests originating from blockchain client hosts

How to Mitigate CVE-2026-111171

Immediate Actions Required

  • Upgrade web3.py to a fixed release above 7.16.0 or above 8.0.0 as published in Pull Request #3875
  • Disable CCIP Read in client configuration if the feature is not required by the application
  • Audit smart contract allowlists so that only trusted contract addresses can trigger OffchainLookup reverts in production workloads

Patch Information

The fix is tracked in web3.py Pull Request #3875 and documented in GHSA-5hr4-253g-cpx2. The patch extends _check_ip_blocked() to unwrap IPv4-mapped IPv6 addresses before evaluating the blocklist. Downstream consumers should also pull the equivalent change from the ApeWorX advisory. Additional context is available in the Vulncheck advisory.

Workarounds

  • Force IPv4-only resolution for the HTTP session used by web3.py to prevent AAAA records from being honored
  • Place the client behind an egress proxy that rejects destinations in RFC1918, loopback, and link-local ranges regardless of address family
  • On cloud workloads, require IMDSv2 with hop-limit 1 to blunt SSRF probes against 169.254.169.254
bash
# Configuration example: pin to a patched release
pip install --upgrade 'web3>7.16.0'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.