当前位置:首页 > 报告详情

MatthewJiang-Rustle - 2023RustChinaCon.pdf

上传人: 2*** 编号:132026 2023-06-30 28页 4.49MB

1、第三届中国Rust开发者大会Rustle:the first static analyzer for smart contracts in RustMatthew JiangDirector of Security Team BlockSecMotivationBackgroundDesign123Capability UsabilityConclusion456OutlineMotivationWhy do we develop Rustle?Emerging chains with Rust as smart contracts language MotivationLimitations

2、 of manual auditTime-consumingExpensiveSkilled auditorsError-proneMotivationMotivationCurrent tools:Dont support contracts in RustBackgroundLLVM IRDesignC;C+RustGoFront-endClangRustcGollvmLLVM IRBack-endx86ARMBPFWASMLLVM Pass:rich APIs to analysis the LLVM IR BackgroundNearBlockchains with smart con

3、tracts in RustRustWebAssemblySolanaRustBPFThough they are compiled into bytecode in different formats,we can analyze the logic on the LLVM IRRich experience in auditing smart contracts in RustBackgroundDesignWorkflowDesignCompileSmart ContractsLLVMIRLLVM PassExtractedPatternsPattern MatchAnalysisRes

4、ultsDesign#private pub fn callback_withdraw(&mut self,amount:U128)match env:promise_result(0)PromiseResult:NotReady=unreachable!(),PromiseResult:Successful(_)=self.balance-=amount.0;PromiseResult:Failed=;pub fn withdraw(&mut self,amount:U128)-Promise assert!(self.balance=amount.into(),insufficient b

5、alance);ext_ft_core:ext(self.token_id.clone().with_attached_deposit(1).with_static_gas(GAS_FOR_FT_TRANSFER_CALL).ft_transfer_call(self.depositor.clone(),amount,None,.to_string().then(ext_self:ext(env:current_account_id().with_static_gas(GAS_FOR_FT_RESOLVE_TRANSFER).with_attached_deposit(0).callback_

6、withdraw(amount),)ExampleReentrancy point,hand over control flow to external contractself.balance hasnt been modified upon second entranceft_transfer_call()Reentrancy AttackState changeDesignpub fn callback_withdraw(&mut self,amount:U128)match env:promise_result(0)PromiseResult:NotReady=unreachable!

word格式文档无特别注明外均可编辑修改,预览文件经过压缩,下载原文更清晰!
三个皮匠报告文库所有资源均是客户上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作商用。
本文介绍了第三届中国Rust开发者大会Rustle:首个针对Rust智能合约的静态分析器。Rustle由BlockSec安全团队负责人Matthew Jiang开发,旨在解决手动审计耗时、昂贵且易出错的问题。背景部分提到,现有的工具不支持Rust智能合约,而Rustle可以分析不同格式字节码背后的逻辑。它已支持多种区块链平台,如Solana和Rust BPF,并具有丰富的审计经验。设计方面,Rustle的工作流程包括编译智能合约、提取模式、模式匹配分析等。它能够定位30多种不同类型的漏洞,并支持扩展新的检测器。Rustle易于使用,支持多平台部署,并提供了多种结果格式。结论部分强调Rustle是首个集成到工作流程中的Rust智能合约静态分析器,支持多种安全漏洞检测,并易于扩展。最后,文章呼吁贡献代码,并提供了联系方式和链接。
Rustle如何提高智能合约审计的效率? Rustle支持哪些类型的智能合约安全漏洞检测? 如何扩展Rustle以发现新的安全漏洞?
客服
商务合作
小程序
服务号
折叠