🇰🇷 한글 설명
Ethermint v0.17.2 미만 버전에서 selfdestruct 호출 시 동일한 바이트코드를 공유하는 모든 계약의 코드가 데이터베이스에서 영구적으로 삭제되는 취약점입니다. DeleteAccount 함수의 버그로 인해 특정 계약이 파괴되면 동일한 CodeHash를 가진 다른 계약들도 작동을 멈추게 됩니다. 이 문제는 v0.18.0에서 패치되었으나 상태 머신 변경이 수반되므로 주의가 필요합니다.
💡 쉬운 설명
똑같은 설계도로 만들어진 여러 개의 계약 중 하나를 삭제하면, 삭제하지 않은 나머지 계약들까지 모두 망가져 버리는 오류입니다. 설계도 자체가 데이터베이스에서 사라지기 때문에 발생하는 문제입니다.
🇺🇸 원문 (English)
Ethermint is an Ethereum library. In Ethermint running versions before `v0.17.2`, the contract `selfdestruct` invocation permanently removes the corresponding bytecode from the internal database storage. However, due to a bug in the `DeleteAccount`function, all contracts that used the identical bytecode (i.e shared the same `CodeHash`) will also stop working once one contract invokes `selfdestruct`, even though the other contracts did not invoke the `selfdestruct` OPCODE. This vulnerability has been patched in Ethermint version v0.18.0. The patch has state machine-breaking changes for applications using Ethermint, so a coordinated upgrade procedure is required. A workaround is available. If a contract is subject to DoS due to this issue, the user can redeploy the same contract, i.e. with identical bytecode, so that the original contract's code is recovered. The new contract deployment restores the `bytecode hash -> bytecode` entry in the internal state.
📍 영향받는 시스템
Ethermint versions prior to v0.17.2
⚔️ 공격 벡터
동일한 바이트코드를 공유하는 계약 중 하나가 selfdestruct 명령을 실행하여 공유된 코드 해시를 삭제함
🛡️ 대응 방법
Ethermint v0.18.0 이상으로 업그레이드하거나, 서비스 중단 시 동일한 바이트코드로 계약을 재배포하여 코드를 복구함
🔧 검증 코드
출력된 버전이 v0.17.2 미만인 경우 해당 취약점에 노출된 상태입니다.
echo 'v0.17.1' | grep -E 'v(0\.[0-9]+\.[0-9]+)'