【原创】chrome已提交的两个漏洞分析(一)

优选教程   © 文章版权由 admin 解释,禁止匿名转载

#楼主# 2022-1-25

早在chrome一次更新修复该漏洞后就关注到了这个漏洞,不过当时是一个研究者一次提交了两个漏洞,还都是21000美元的高悬赏,我当时只注意到了CVE-2021-30598的两次patch,看到其中一次将typeguard改为checkbound,猜测是可以达到rce的。

30598
30599

环境搭建 :
在v8环境搭完后
git reset --hard 27a517b8922915f53d479133205ee80b35ac2feb
gclient sync

漏洞分析:
这是发生在machine-operator-reducer.cc(

本帖含有隐藏内容,请您 回复 后查看
)中的漏洞(Turbofan),具体来说是其中的BitfieldCheck的一些处理不正确。

static base::Optional Detect(Node* node) {
// There are two patterns to check for here:
// 1. Single-bit checks: `(val >> shift) & 1`, where:
// - the shift may be omitted, and/or
// - the result may be truncated from 64 to 32
// 2. Equality checks: `(val & mask) == expected`, where:
// - val may be truncated from 64 to 32 before masking (see
// ReduceWord32EqualForConstantRhs)
if (node->opcode() == IrOpcode::kWord32Equal) {
Uint32BinopMatcher eq(node);
if (eq.left().IsWord32And()) {
Uint32BinopMatcher mand(eq.left().node());
if (mand.right().HasResolvedValue() && eq.right().HasResolvedValue()) {
BitfieldCheck result{mand.left().node(), mand.right().ResolvedValue(),
eq.right().ResolvedValue(), false};
[ ... ]
可以看到对于(val & mask) == expected这种操作会被替换为BitfieldCheck,然后在一些情况下,两个BitfieldCheck会合并成一个,比如((x & 0) == 1) & ((x & 1) == 0),这样的情况就会由二合一,但是漏洞也是在合并过程中产生的。
#【原创】chrome已提交的两个漏洞分析(二)#

成为第一个回答人

评论

登录后才可发表内容
  • 主题

    20

  • 帖子

    80

  • 关注者

    0

Copyright © 2019 凯特网.   Powered by HYBBS 2.3.4  

Runtime:0.2663s Mem:1966Kb