본문 바로가기

브라우저

(9)
ASIS CTF Quals 2021 - V8 for dummies diff --git a/src/compiler/js-call-reducer.cc b/src/compiler/js-call-reducer.cc index 5e26a68ada..a3638ef5b3 100644 --- a/src/compiler/js-call-reducer.cc +++ b/src/compiler/js-call-reducer.cc @@ -6260,12 +6260,11 @@ Reduction JSCallReducer::ReduceArrayIteratorPrototypeNext(Node* node) { Node* etrue = effect; Node* if_true = graph()->NewNode(common()->IfTrue(), branch); - // This extra check exist..
CCE 2021 - shlowering 취약점 분석 JSCreateLowering에 최적화 phase를 하나 더 추가했다. jscreate의 size가 add, bit shift, sub로 계산될 경우, 해당 값을 최적화하는 로직이다. Reduction JSCreateLowering::ReduceHandleCCE( Node* bnode, Node* node, Node* length, MapRef initial_map, ElementsKind elements_kind, AllocationType allocation, const SlackTrackingPrediction& slack_tracking_prediction) { int capacity = 0; Node* newLength = length; Node* const value = bnode..
CVE-2020-6383 취약점 요약 a security issue in the implementation of loop variable analysis. The patch makes the typer recognize cases where in statements like for (var i = start; i < ...; i += increment) { ... } the loop variable can become NaN because start and increment are Infinity values of differing sign[1]. Unfortunately, the introduced check is not sufficient to catch all loops that can produce NaN. The cod..
DownUnderCTF 2020 / is-this-pwn-or-web 같이 스터디하는 분이 CTF에 V8 나왔다고 알려줘서 풀어봤습니다. 취약점 Slice로 생성되는 array에서 OOB가 발생합니다. V8에선 OOB object가 생성되면 익스플로잇은 늘 하던 거 그대로 하면 되기 때문에 따로 자세히 설명하지는 않겠습니다. 다만 Exploit을 하다보면 OOB의 Base가 V8 heap이 아닌 다른 영역인데 이 부분은 나중에 분석 후 설명을 업로드할 예정입니다. (2021-10-29 young geneation ) diff --git a/src/builtins/array-slice.tq b/src/builtins/array-slice.tq index 7b82f2bda3..4b9478f84e 100644 --- a/src/builtins/array-slice.tq +++ ..
Chrome v8 / CVE-2019-5791 취약점 요약 AST 단계와 Bytecode-generator 단계에서는 각각 Dead-code Elimination을 수행합니다. CVE-2019-5791는 AST 단계와 Bytecode-generator 단계에서 Dead-code Elimination을 수행하는 방식이 달라서 발생한 취약점입니다. AST에서보다 Bytecode-generator에서 Dead-code를 판단하는 기준이 엄격합니다. 따라서 Bytecode-generator에서는 dead-code라고 판단하지 않은 코드를 AST에서는 dead-code라고 판단하는 경우가 발생합니다. 이는 AST와 Bytecode-generator에서 사용하는 Literal_array의 idx값이 달라지게 되고, Type Confusion이 발생하게 됩니다...
pwn2win 2020 / omnitmizer # Make POC patch 파일과 d8.exe가 주어집니다. patch 파일을 보면 escape-analysis.cc의 reduce함수에서 case IrOpcode::kCheckMaps:을 거의 지워버린 것을 볼 수 있습니다. reduce 함수는 사용자 정의 함수를 최적화할 때 사용되는 함수 중 하나입니다. 따라서 escape-analysis 최적화를 할 때 Maps(타입) 검사를 지워버리는 패치라고 이해할 수 있습니다. https://github.com/v8/v8/tree/50dd84ca317ae35c926ed34d001a72b62aea6662 diff --git a/src/compiler/escape-analysis.cc b/src/compiler/escape-analysis.cc index b3..
Chrome v8 / CVE-2020-6418 # 취약점 요약 # Incorrect side effect modelling for JSCreate The function NodeProperties::InferReceiverMapsUnsafe [1] is responsible for inferring the Map of an object. From the documentation: "This information can be either "reliable", meaning that the object is guaranteed to have one of these maps at runtime, or "unreliable", meaning that the object is guaranteed to have HAD one of these maps.". In..
Chrome v8 / CVE-2019-5825 var buf = new ArrayBuffer(8); // 8 byte array buffer var f64_buf = new Float64Array(buf); var u64_buf = new Uint32Array(buf); function ftoi(val) { // typeof(val) = float f64_buf[0] = val; return BigInt(u64_buf[0]) + (BigInt(u64_buf[1]) > 32n); return f64_buf[0]; } function hex(val){ return "0x"+val.toString(16) } Array(2 ** 30); function assert(x){ if(x){ return; } else{ throw "assert fail"; } }..