Cobo 安全团队:牛市 DeFi 交互指南

币圈资讯 阅读:36 2024-04-22 04:54:55 评论:0
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

DeFi 固然可以带给用户可观的收益,但是资金安全才是资产稳步增长的核心。Cobo 安全团队梳理了 DeFi 交互中常见的安全风险及对应的安全防范措施,希望可以对大家在牛市中的 DeFi 安全交互有所启发和帮助。

自 2019 年 DeFi Summer 开启后,以以太坊为首,出现了越来越多富有创意的去中心化金融协议(DeFi 协议),大大丰富了链上资产的可用性,使区块链用户可以更好地利用链上资产进行更多样的金融活动并为此创造丰厚的收益。但随着越来越多 DeFi 协议的兴起,安全挑战也随之而来。据不完全统计,仅 2023 年一年,因区块链攻击而导致的资产损失已达到 26.1 亿美元。可见,在参与 DeFi 协议的过程中,除了评估对应的收益预期以外,协议安全性方面的评估也不可忽视,否则会给用户带来大的损失。

一般而言,目前对协议安全评估的主流定义为代码的安全性评估,这种定义的维度是比较单一的,这里的问题在于,评估的本身只是考虑了协议在静态过程下的安全性,而在 DeFi 交互过程中,安全性往往是动态的,包含账户管理、协议交互前的准备、交互完成后的资产管理、数据监控及极端情况下资产损失后的自救等多个阶段。

作为一个即将要进入 DeFi 新手村的用户,该如何在赚取收益的同时最大限度地保障资金的安全?Cobo 安全团队梳理了 DeFi 交互中常见的安全风险及对应的安全防范措施,希望可以对大家在牛市中的 DeFi 安全交互有所启发和帮助。

DeFi 交互中的常见安全风险和防范措施

一、账户私钥泄露

账户私钥泄露是目前新手用户较为容易中招的问题之一,由于当前市面上钱包种类繁多,新手用户缺乏自行判别钱包安全性的能力,很多新手用户会下载一些不安全的钱包,并使用其来生成私钥,从而导致私钥被恶意回传到攻击者手中,造成私钥泄露。很多资深用户发现自己的主账号在某一天被转走所有资产,分析大半天发现所有行为都正常,这种案例下大部分情况就是早期该账户使用了不安全的钱包来生成自己的私钥导致私钥早已泄露。

同时,由于区块链空投导致的财富效应,很多新手用户会盲目点击一些所谓的空投网站,这些空投网站将自己包装成非常正经的项目网页,并告诉用户存在大量未领取代币。在利益的驱使下,很多新手用户会在网页的诱导下,填入自己的账户私钥,导致私钥泄露。

为了防止私钥泄露,用户需要做到以下几点来加以防范:

  • 使用知名度较高的区块链钱包,并从对应的官网进行钱包的下载。有条件的用户建议使用硬件钱包。

  • 永远不要将自己的私钥明文暴露在联网环境中,也不要随意将自己的私钥输入到任何网页当中。

二、签名钓鱼风险

签名钓鱼风险和私钥泄露一样,同样也是新手用户的重灾区。区别于直接让用户填入私钥,此类钓鱼攻击则是诱导用户发起一笔交易或签名,从而获取用户相关资产的授权,具有隐蔽性高、不易分析以及难以察觉等特点。

通常,攻击者会先把用户诱导到钓鱼网页中,以领取空投、验证登录等名义让用户发起签名,此时,用户的浏览器钱包提示用户需要完成签名。

钓鱼交易的类型可能有多种:

  • 直接转账类型。直接转账 ETH 或进行 ERC20 transfer 调用将钱包资产转移到攻击者地址。

  • Approve 类型。调用 ERC20 Approve 方法授权攻击者钱包。用户签名时不会发生资产转移。但攻击者钱包可通过调用 transferFrom 转移用户资产。

  • EIP712 消息签名。如 ERC20 Permit 方法;Permit2 授权;NFT 挂单签名等。此类签名通常在钱包中展示为 Json 数据或者格式化较好的树状数据。用户签名时不会发起交易,不会有 gas 消耗。但签名结果会被钓鱼网站记录,攻击者可以使用该签名结果转移受害者的 ERC20 或 NFT 资产。

  • 原始 hash 签名。签名数据为 16 进制 hash 数据,从签名数据本身无法推断具体的签名内容。hash 背后可能是上述 1-3 种类型数据。签名很可能导致资产损失。不过目前主流钱包通常会禁止此种签名方式或者予以明显的风险提示。

最近一些案例中还发现某些钓鱼网站会要求用户连续进行多笔签名,且前几笔均为无害的正常签名。然后混杂一笔恶意签名内容。利用用户的操作惯性诱导用户完成签名操作。

为了防止钓鱼导致的资金损失,核心在于拒绝盲签。对于每笔签名认真审核,对于不确定内容的交易拒绝签名。具体来说,可以在签名过程中注意以下内容:

  • 确认交互网站为 DeFi 项目官网,检查完整域名。

  • 检查合约调用的方法,对于 transfer, approve 方法重点检查。

  • 检查交易附带的 ETH 转账。某些钓鱼网站会尝试构造看起来安全的方法(如 Claim),但实际会在调用时附带 ETH 转账造成 ETH 等链原生代币的损失。

  • 不签名原始 hash 内容

三、转账地址投毒

转账地址投毒为近来较为新颖的攻击方式,其攻击手法为在用户发起一笔转账(ERC20, native token 等)时,使用与该交易中的接收地址相似的地址,向用户发送一笔金额相同的交易,或金额相同但对应代币为 fake token 的交易。

举例:

Alice 每月会固定转移了 1 ETH 给 Bob 作为薪资发放。Charlie 监控到了这笔交易,用与 Bob 相似的地址(地址前 8 位和后 8 位相同)发送 0.001 ETH 给 Alice。这种操作后,在下次 Alice 再向 Bob 转账的时候,就有可能使用 Charlie 的地址来作为交易的接收地址。会发生这样的情况的原因在于区块链地址长度较长且无规律,用户难以记忆,导致很多时候用户会贪图方便直接从上一次的交易记录中复制地址。由于 Charlie 和 Bob 的地址极为相似,导致 Alice 难以分辨,最终导致资产损失。

为了防止中招转账地址投毒,用户可以采取以下手段进行防范:

  • 每次交易均核对转账地址,且要核对完整内容而不是仅比较前后几字节。

  • 将常用的的地址设置进地址白名单(地址簿)中设置别名,尽量只使用地址簿中的地址进行转账。

  • 避免将从链上渠道(包括区块链浏览器、钱包交易记录等)中复制地址作为转账目标。

四、代币过度授权

代币授权几乎是进行 DeFi 交互的第一步。在进行 DeFi 操作时,由于交易数据是通过项目方网页构造而不是用户构造,在通常情况下,为了方便用户多次交互而不需要重复授权,项目方网页通常会构造一个无限授权的交易让用户签名。其出发点是为用户节省 gas,但是这也为后续资金安全埋下了隐患。假设后续项目代码发生问题,如未授权接口,或任意调用漏洞,用户对合约的无限授权将导致被攻击者利用,导致用户资产被转移。这种攻击场景在跨链桥和 DEX 协议中较为常见。

为了防止后续项目在升级中引入风险代码或项目代码本身存在未发现的漏洞,用户应采用最小授权的原则,尽量仅授权本次交易中使用到的额度,防止后续项目风险导致自己的资产损失。

五、不安全的 DeFi 操作

除了交互前的准备外,在交互过程中同样存在很多容易忽视的风险。这些风险通常源于用户对项目本身的不了解导致。具体的例子为:

  • 在通过链上兑换协议进行代币兑换时滑点设置过大或者编写脚本进行 swap 没有设置最低接收数量(出于编写方便设置为 0),导致交易受到 MEV 机器人的“三明治”攻击。

  • 在通过链上借贷协议进行借贷操作时,没有对仓位健康度进行及时管理,导致大波动行情中仓位被清算。

  • 在与某些项目交互时,没有对项目方凭证进行良好的保管,如把 Uniswap V3 的 NFT 凭证当成是普通 NFT 到 OpenSea 中进行售卖。

为了防范这些风险,用户在进行项目交互时,一定要做好对应的项目调研,明确项目机制和相关特性,防止资产损失。

DeFi 安全交易新范式 -- Cobo Argus

上文介绍了在区块链进行 DeFi 活动常见的交互风险。用户不小心中招其中一个,都有可能导致多年的努力全盘皆失,稍有不慎万劫不复。那么,是否存在一个安全有效,又便于管理的风控方案呢?一个新的选择方案是 Cobo Argus。

Cobo Argus 是一款由 Cobo 团队进行开发,基于 Gnosis Safe 进行构建的链上风控产品。主要的作用在于可以通过构建不同的 ACL 策略,对用户交易进行解析,对其中不符合风控规则的交易进行拦截,从而确保用户资金安全。

Cobo Argus 如何应对 DeFi 环境中的安全风险?

1. 底层多签钱包,上层单签授权:避免私钥泄露单点风险,减缓被钓鱼风险,同时保证操作效率

Cobo Argus 是一个基于 Safe {Wallet} 的多签钱包构建的产品,其基础和核心为多签合约钱包。所以 Cobo Argus 天然继承了 Safe {Wallet} 多签钱包的安全性。

通过把资金从单个私钥管理变成多个私钥共同维护,可以杜绝由单个私钥泄露带来的资产丢失/锁定风险。多签钱包本身需要多个签名来触发交易的执行,单个地址私钥的泄露也不会影响总体资金的安全。另外可以发起多签交易来替换丢失或有风险的单签地址,保证多签钱包的安全性。

另外由于从单签地址切换到了多签地址后,在交易签名时,需要每个用户对一笔交易进行签名,有利于交叉审计交易内容,从而大大降低了被钓鱼的可能性。

多签由于需要多人审核,对操作效率有一定影响。Cobo Argus 允许用户配置灵活的授权规则,允许将某些风险较低的高频操作(如进行 Farming 时定期 Claim 收益的操作)授权给某个 EOA 地址。该地址可以代替多签钱包发起操作,提高工作效率。同时由于该地址权限被严格限制,钱包整体的安全性不会受到明显影响。

2. 自定义机器人:7*24 小时自动风险监测与响应

通过配置 Cobo Argus 监控机器人,可以自定义需要监控的条件和触发条件需要执行的操作。

以借贷项目的杠杆管理为例,用户可以通过配置 Argus 机器人监控自己的 health factor,当仓位接近清算时,可以由机器人进行补充抵押物、还款等降低杠杆的操作。

3. 自定义的 ACL 策略

除了自定义监控机器人以外,有一定开发能力的用户,还可以通过开发自定义的 ACL(Access Control List)合约来实现更加灵活的权限管理。这是 Cobo Argus 的核心功能之一。下面通过若干例子来感受该功能的魅力所在:

  1. 针对地址投毒攻击,可以通过编写 ACL 合约,用户可以在 ACL 合约中指定常用的地址作为白名单,在交易过程中,ACL 合约会对交易中的接收地址进行解析(ERC20 / native token),并对用户设置的白名单地址进行比对,如果接收地址不在对应的地址内,则该笔交易无法成功完成。

  2. 针对过度授权问题,用户可以通过编写 ACL 策略合约对 Approve 交易中的授权额度进行解析,限制代币的 Approve 授权额度不超过用户预设值。或1可通过配置自定义机器人,定期对相关代币的授权清零。

  3. 针对不安全的 DeFi 操作,如无滑点检查的 swap 交易,可以通过编写 Argus ACL 策略合约,设定兑换交易可接受的最低滑点,在设置完成后,ACL 策略合约便可根据设定的滑点对不同的 swap 交易进行解析,如果兑换滑点不满足,则可以对该笔交易进行拦截。

总结

DeFi 交互中存在很多难以防范的风险,文中提到的内容虽然涉及了很多常见场景,但也不能完全覆盖所有风险点。用户需要认真处理每一笔交易。

Cobo Argus 可以为用户提供可靠且易于配置的手段来防范常见的一些安全风险。通过 ACL 可以完成灵活且安全的授权管理,在保证安全性的前提下,提高操作效率;自定义机器人则可以减少人工操作,同时实时监控的能力可以 7*24 小时保障用户资金安全。

DeFi 固然可以带给用户可观的收益,但是资金安全才是资产稳步增长的核心。Cobo Argus 将守护每位 DeFi Farmer,帮助大家在牛市创造更多价值。


Although it can bring considerable benefits to users, the security of funds is the core of the steady growth of assets. The security team combed the common security risks in the interaction and the corresponding security precautions, hoping to inspire and help everyone in the safe interaction in the bull market. Since the opening of the year, more and more creative decentralized financial protocols led by Ethereum have emerged, which greatly enriched the availability of assets on the chain and enabled blockchain users to make better use of the assets on the chain for more diversified finance. Activities and create rich benefits, but with the rise of more and more protocols, security challenges also follow. According to incomplete statistics, the asset loss caused by blockchain attacks has reached hundreds of millions of dollars in one year alone. It can be seen that in the process of participating in the agreement, in addition to evaluating the corresponding income expectations, the evaluation of protocol security can not be ignored, otherwise it will bring great losses to users. Generally speaking, the mainstream definition of protocol security evaluation is code security evaluation, and the dimension of this definition is relatively. The single problem here is that the evaluation itself only considers the security of the agreement in the static process, while the security in the interaction process is often dynamic, including the preparation before the interaction of the account management agreement, the monitoring of asset management data after the interaction, and the self-rescue after the loss of assets in extreme cases. As a user who is about to enter the novice village, how to earn income while maximizing the protection of funds, the security team combed the common security risks and The corresponding security precautions hope to enlighten everyone's security interaction in the bull market and help the common security risks and preventive measures in the interaction-account private key disclosure is one of the problems that novice users are easy to recruit at present. Because there are many kinds of wallets in the market, novice users lack the ability to judge the security of wallets by themselves, many novice users will download some unsafe wallets and use them to generate private keys, which will lead to the private keys being maliciously returned to attackers. Many experienced users found that their main account was transferred on a certain day, and all the assets analysis found that all the behaviors were normal for a long time. In most cases, the account used an unsafe wallet to generate its own private key in the early days, which led to the leakage of the private key. At the same time, due to the wealth effect caused by blockchain airdrop, many novice users blindly clicked on some so-called airdrop websites, which packaged themselves into very serious project pages and told users to save them. Driven by a large number of unpaid tokens, many novice users will fill in their private keys under the guidance of web pages, which will lead to the disclosure of private keys. In order to prevent the disclosure of private keys, users need to do the following to take precautions, use well-known blockchain wallets and download wallets from the corresponding official website. Conditional users suggest using hardware wallets, and never expose their private keys in plain text in the networking environment, and never enter their private keys into any web pages at will. Fishing Risk Signature Fishing Risk is also the hardest hit area for novice users, just like the disclosure of private keys. It is different from directly letting users fill in private keys. This kind of phishing attack is to induce users to initiate a transaction or signature to obtain the authorization of users' related assets, which is characterized by high concealment, difficulty in analysis and imperceptible detection. Usually, attackers will first induce users to sign in the name of receiving airdrop verification login, etc. At this time, the user's browser wallet prompts the user to complete the signature. There may be many types of phishing transactions, such as direct transfer, direct transfer or call to transfer wallet assets to attacker's address type. Call method to authorize attacker's wallet. Asset transfer will not occur when the user signs, but the attacker's wallet can transfer user's asset message signature through call, such as method authorization pending order signature. Such signatures are usually displayed in the wallet as data or well-formatted tree data. When the user signs, the transaction will not be initiated, but the signature result will be consumed by phishing websites. Record the attacker can use the signature result to transfer the original signature data of the victim or assets into binary data. It is impossible to infer the specific signature content from the signature data itself. The signature of the above types of data is likely to lead to asset loss. However, at present, mainstream wallets usually prohibit this signature method or give obvious risk warnings. Recently, in some cases, it has been found that some phishing websites will require users to sign multiple signatures in succession and the first few are harmless normal signatures. Mix a malicious signature content and use the user's operational inertia to induce the user to complete the signature operation. In order to prevent the financial loss caused by phishing, the core is to refuse blind signing. Carefully examine each signature and refuse to sign for transactions with uncertain content. Specifically, you can pay attention to the following contents during the signing process: confirm the interactive website to check the complete domain name for the project official website. Check the method called by the contract. Focus on the method and check the transfer attached to the transaction. Some phishing websites will try to construct a seemingly safe one. For example, it will actually cause the loss of the original tokens in the same chain when it is called. The original content is not signed. The transfer address is poisoned. The transfer address poisoning is a relatively new attack method recently. The attack method is to send a transaction with the same amount to the user with an address similar to the receiving address in the transaction when the user initiates a transfer, or a transaction with the same amount but corresponding tokens. For example, it will be transferred regularly every month to monitor the transaction as salary payment. The first and last bits of the address are the same. After this operation, the address that may be used in the next transfer is used as the receiving address of the transaction. The reason for this situation is that the blockchain address is long and irregular, which makes it difficult for users to remember. Many times, users will copy the address directly from the last transaction record for convenience. Because the address is very similar to the address, it is difficult to distinguish and eventually lead to asset loss. In order to prevent the transfer address from being poisoned, users can take it. The following measures are taken to prevent every transaction from checking the transfer address and checking the complete content instead of just comparing the first few bytes. Set the commonly used addresses into the address white list address book and set aliases. Try to use only the addresses in the address book to transfer money. Avoid copying addresses from online channels, including blockchain browser wallet transaction records, as the transfer target. Over-authorization of four tokens is almost the first step in interaction. Because the transaction data is constructed by the project party's webpage rather than the user's, it is not necessary to repeatedly authorize the project in order to facilitate the user's multiple interactions. 比特币今日价格行情网_okx交易所app_永续合约_比特币怎么买卖交易_虚拟币交易所平台

文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明 网址:https://netpsp.com/?id=57502

美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
可以去百度分享获取分享代码输入这里。
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
关注我们

若遇到问题,加微信客服---清歌

搜索
排行榜
扫一扫,加我为微信好友加我为微信好友