Skip to content

绕过object权限检测

High
steelgeek091 published GHSA-2mh8-rvf9-mq47 Oct 30, 2024

Package

No package listed

Affected versions

<0.7.6

Patched versions

None

Description

Summary

构造合约方法传递vector<Object<MockObject>>会绕过object的owner检测

Details

合约方法vector<Object<MockObject>>传入一个不存在的object或者其他用户的object可以绕过检测

PoC

`
struct MockObject has key, store{
}
public entry fun createMock(){
transfer(object::new(MockObject{}),@user_a)
}

public entry fun attack(objs: vector<Object>){
//TODO
}
`
创建userB 调用createMock方法创建 Object 并发送给userA, userB可以调用attack方法使用userA的object

Impact

用户资产会受影响

Severity

High

CVE ID

No known CVE

Weaknesses

No CWEs