본문 바로가기

분류 전체보기

Chrome V8 Hole Exploit Prerequisite Knowledge Hole Object V8에서 hole은 빈 공간을 나타내는 객체로써, oddball type으로 사용자가 직접 컨트롤할 수 없는 객체입니다. /* v8/src/compiler/js-call-reducer.cc */ // The contract is that we don't leak "the hole" into "user JavaScript", // so we must rename the {element} here to explicitly exclude "the hole" // from the type of {element}. 만약 hole 객체에 접근하게 된다면 사용자는 undefined로 변환된 데이터만 확인할 수 있습니다. d8> %DebugPrint(%Th..
CVE-2023-3079 (Bug in the handling of the arguments object) Environment Setting Install depot_tools cd ~ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git export PATH=~/depot_tools:$PATH Get V8 source code mkdir v8 cd v8 fetch v8 cd v8 git checkout 4217c51611830d98d7fd7b8c922571942a87ad2e gclient sync -D Install build dependencies ./build/install-build-deps.sh Build V8 gn gen out/debug --args="v8_no_inline=true v8_optimized_debug..
CVE-2023-2033 (JIT optimisation issue) Environment Setting Install depot_tools cd ~ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git export PATH=~/depot_tools:$PATH Get V8 source code mkdir v8 cd v8 fetch v8 cd v8 git checkout f7a3499f6d7e50b227a17d2bbd96e4b59a261d3c gclient sync -D Install build dependencies ./build/install-build-deps.sh Build V8 gn gen out/debug --args="v8_no_inline=true v8_optimized_debug..
Defcon 31
CVE-2021-38003 (JSON.stringify leaks TheHole value, leading to RCE) Environment Setting OS: Ubuntu 20.04 64-bit Memory: 8GB Processors: 8 Hard Disk: 100GB Install depot_tools V8 빌드를 위해 depot_tools를 설치합니다. cd ~ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git export PATH=$PWD/depot_tools:$PATH Download V8 source code V8 소스 코드를 다운받고, 패치 바로 이전 커밋인 a4252db3228433fed5c2bdb0fdff9a6b7b638f3b로 이동합니다. mkdir v8 cd v8 fetch v8 cd v8 git checkout a..
Windows Ancillary Function Driver for WinSock Elevation of Privilege Vulnerability (CVE-2023-21768) Introduction 2023년 1월 10일, Patch Tuesday에 MSRC로부터 Ancillary Function Driver(AFD.sys)에 존재하는 EoP 취약점이 공개되었고, IBM X-Froce의 @chompie와 @b33f는 일명 Patch Tuesday, Exploit Wednesday로 일컫는, 취약점의 patch가 공개된 다음날 취약점을 weaponizing 하는 연구 결과를 공개하였다. 해당 연구에서는 임의의 주소에 0x1을 쓰는 취약점을 Yarden Sharif가 공개한 IoRing Primitive를 활용, Full AAR/AAW로 확장하여 EoP를 달성하였다. chompie와 b33f의 연구에서 0x1을 쓰는 것을 넘어 더 큰 값을 쓸 수 있는 가능성을 제시하였지만, 더 ..
CVE-2019-5782 (Incorrect optimization assumptions in V8) Background Typer in Turbofan JavaScript의 dynamic type system은 사용자에게는 편의를 제공하지만, JS 엔진의 입장에서는 코드와 메모리 관리를 매우 까다롭게 합니다. 예를 들어, a + b라는 아주 간단한 덧셈 연산도 a와 b의 type에 따라 연산 결과의 type이 달라집니다. JIT 컴파일러는 피연산자와 연산 결과의 type에 대해 가능한 모든 경우를 고려하여 어떻게 처리할지 준비해 두어야 하는데, 이는 매우 비효율적인 작업일 것입니다. V8에서는 type speculation을 통해 이 문제를 해결합니다. V8의 JIT 컴파일러인 Turbofan은 함수가 호출될 때 연산 과정에서 사용되는 type 정보를 기록해 두었다가, runtime에 그 정보를 활용하..
CVE-2020-6418 (Incorrect side effect modelling for JSCreate) Background Map inference in v8 V8에서 map inference는 최적화 과정에서 object의 map, 즉 type을 추론하는 작업입니다. Object의 map은 runtime에 바뀔 수 있습니다. 예를 들어 다음과 같은 상황을 생각해볼 수 있습니다. [1, 2, 3]은 small integer들의 배열이므로, a의 map은 PACKED_SMI_ELEMENTS입니다. a[0]의 값을 1.1로 바꾸면 a는 더 이상 small integer들의 배열이 아니게 되고, 따라서 map도 바뀌어야 합니다. 이 경우에는 double형 상수들의 배열이므로 a의 새로운 map은 PACKED_DOUBLE_ELEMENTS가 됩니다. /* src/compiler/map-inference.h */ /..