🇰🇷 한글 설명
WebAssembly wabt 1.0.41 버전의 wasm2c에서 32비트 플랫폼을 대상으로 하는 샌드박스 탈출 취약점이 발견되었습니다. calloc()의 반환값을 확인하지 않아 메모리 할당 실패 시 NULL 포인터가 발생하며, 이를 통해 호스트 프로세스의 메모리에 임의로 접근하거나 코드를 실행할 수 있습니다. Firefox와 같이 RLBox나 WasmBoxC를 사용하는 애플리케이션의 보안 격리 기능이 무력화될 수 있습니다.
💡 쉬운 설명
웹 어셈블리를 실행하는 도구에서 메모리 할당 오류를 제대로 처리하지 못해 발생하는 보안 결함입니다. 공격자가 이 허점을 이용하면 격리된 환경을 뚫고 컴퓨터의 중요한 데이터에 접근하거나 악성 프로그램을 실행할 수 있습니다.
🇺🇸 원문 (English)
wasm2c in WebAssembly wabt through 1.0.41 allows sandbox escape in some situations that primarily involve 32-bit platforms, aka a "table flip" attack. It does not check the return value of calloc() in wasm_rt_allocate_funcref_table() (wasm2c/wasm-rt-impl-tableops.inc). When the funcref table allocation fails, table->data is left NULL while table->size keeps the guest-declared element count; thus, bounds checks still pass and table element accesses resolve to absolute memory addresses (i * sizeof(wasm_rt_funcref_t)). This gives arbitrary read and write of host process memory and - via table.get, table.set, and call_indirect - arbitrary code execution, defeating the isolation that wasm2c exists to provide (a full sandbox escape). wasm2c is used as an in-process sandboxing boundary by RLBox and WasmBoxC, including in Firefox, which compiles the Graphite, Hunspell, Ogg, Expat, and Woff2 libraries via wasm2c to contain untrusted font, media, and XML input. Therefore, sandboxing in these applications is potentially affected. Exploitation requires the funcref table allocation to fail, for example under an address-space limit (RLIMIT_AS), on 32-bit hosts, with vm.overcommit_memory=2, or under memory pressure. On 64-bit Linux with default overcommit the allocation succeeds and the defect is not triggered. The wasm2c memory allocator aborts on calloc failure in the same runtime; the table allocator lacks this abort behavior. This was introduced in commit ab9e0b55 (PR #813).
📍 영향받는 시스템
wabt 1.0.41 이하 버전 (특히 32-bit 플랫폼 및 RLBox/WasmBoxC 사용 환경)
⚔️ 공격 벡터
메모리 압박 상황을 유도하여 funcref 테이블 할당 실패를 일으킨 후, 잘못된 메모리 주소 접근을 통한 임의 읽기/쓰기 및 코드 실행
🛡️ 대응 방법
wabt를 최신 버전으로 업데이트하거나, 메모리 할당 실패 시 프로세스가 안전하게 종료되도록 런타임 로직을 수정해야 합니다.
🔧 검증 코드
출력된 버전 정보가 1.0.41 이하인지 확인하여 취약 여부를 판단합니다.
wabt --version 2>/dev/null | grep -E '1\[\.\d+\]41'
💻 영향받는 소프트웨어
NVIDIA Cloud Gaming Guest Driver for Linux