🇰🇷 한글 설명
web3.py 라이브러리가 EIP-3668(CCIP Read)을 구현하는 과정에서 스마트 컨트랙트가 제공하는 URL을 검증 없이 HTTP 요청에 사용함으로써 SSRF 취약점이 발생합니다. 공격자가 악성 컨트랙트를 통해 백엔드 서버가 내부 네트워크나 클라우드 메타데이터 엔드포인트로 임의의 요청을 보내도록 유도할 수 있습니다.
💡 쉬운 설명
웹3 라이브러리가 블록체인 정보를 가져올 때, 나쁜 의도를 가진 컨트랙트가 알려주는 주소로 서버가 직접 접속하게 만드는 보안 허점입니다. 이를 통해 해커는 서버 내부의 비밀 정보나 다른 시스템에 접근할 수 있습니다.
🇺🇸 원문 (English)
web3.py allows you to interact with the Ethereum blockchain using Python. From 6.0.0b3 to before 7.15.0 and 8.0.0b2, web3.py implements CCIP Read / OffchainLookup (EIP-3668) by performing HTTP requests to URLs supplied by smart contracts in offchain_lookup_payload["urls"]. The implementation uses these contract-supplied URLs directly (after {sender} / {data} template substitution) without any destination validation. CCIP Read is enabled by default (global_ccip_read_enabled = True on all providers), meaning any application using web3.py's .call() method is exposed without explicit opt-in. This results in Server-Side Request Forgery (SSRF) when web3.py is used in backend services, indexers, APIs, or any environment that performs eth_call / .call() against untrusted or user-supplied contract addresses. A malicious contract can force the web3.py process to issue HTTP requests to arbitrary destinations, including internal network services and cloud metadata endpoints. This vulnerability is fixed in 7.15.0 and 8.0.0b2.
📍 영향받는 시스템
web3.py 6.0.0b3 ~ 7.15.0 미만 및 8.0.0b2 미만 버전
⚔️ 공격 벡터
악성 스마트 컨트랙트의 offchain_lookup_payload 내 URL을 이용한 서버 측 요청 위조(SSRF)
🛡️ 대응 방법
web3.py를 7.15.0 또는 8.0.0b2 이상의 최신 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 버전이 7.15.0 미만이거나 8.0.0b2 미만인 경우 취약한 상태입니다.
pip show web3 | grep Version