上半年NFT安全事件分析:哪些典型案列值得我们警惕?

成都链安Опубліковано о 2022-09-09Востаннє оновлено о 2022-09-09

Анотація

2022年上半年,共监测到NFT领域主要安全事件10起,统计到的损失约为6490万美元。

Mint千万枚,安全第一位。

在我们发布的《2022年上半年Web 3安全态势深度研报》中,我们已经从各个维度展示和分析了区块链安全领域的总体态势。今天,我们将针对NFT合约安全展开分析,看看在NFT合约在审计过程中都会出现哪些常见问题呢?

1、上半年NFT领域安全事件的总损失有多少?

据成都链安鹰眼区块链安全态势感知平台监控显示,2022年上半年,共监测到NFT领域主要安全事件10起,统计到的损失约为6490万美元,主要攻击方式为合约漏洞利用、私钥泄露、钓鱼等。而上半年Discord钓鱼事件频发,几乎每天都有Discord服务器受到攻击,个人用户因点击钓鱼链接而遭受损失的情况频繁发生。

2、上半年NFT典型安全事件?

TreasureDAO事件

2022年3月3日,TreasureDAO交易平台遭到黑客攻击,造成100多个NFT 被盗。

扩展阅读:怪事?盗了又归还?TreasureDAO安全事件分析

漏洞原因:逻辑漏洞

该漏洞存在于TreasureMarketplaceBuyer合约中,该合约的buyItem函数在传入_quantity参数后,并没有做代币类型判断,直接将_quantity与_pricePerItem相乘计算出了totalPrice,因此safeTransferFrom函数可以在ERC-20代币支付数额只有0的情况下,调用TreasureMarketplace合约的buyItem函数来进行代币购买。

本次安全事件主要原因是ERC-1155代币和ERC-721代币混用导致的逻辑混乱,ERC-721代币并没有数量的概念,但是合约却使用了数量来计算代币购买价格,且最后在代币转账的实现中也未进行逻辑分离。

APE Coin空投事件

2022年3月17日,黑客通过闪电贷拿到了超过6万的APE Coin空投。

漏洞原因:逻辑漏洞

该漏洞存在于AirdropGrapesToken空投合约中,由于其使用 alpha.balanceOf()和beta.balanceOf()判定调用者对BAYC/MAYC NFT的所有权。而这种方式仅能获取到用户对该NFT所有权的瞬时状态,但该瞬时状态可以通过闪电贷借入进行操控。攻击者利用该漏洞,以闪电贷借出BAYC NFT并获取对应的空投。

Revest Finance事件

2022年3月27日,Revest Finance项目遭遇黑客攻击,损失余额12万美元。

扩展阅读:老调重弹,ERC1155的重入攻击又“现身”,Revest Finance被攻击事件简析

漏洞原因:ERC-1155重入

该漏洞存在于Revest合约中,当用户采用depositAdditionalToFNFT()追加FNFT的抵押资产时,合约需要将先把之前的FNFT销毁,之后再铸造新的FNFT。但是在铸造时,由于min()函数中未判断需铸造的FNFT是否已经存在,并且状态变量fnftId自增在_mint()函数后。而_min()中存在ERC-1155中的隐藏外部调用_doSafeTransferAcceptanceCheck(),造成了重入漏洞。

NBA薅羊毛事件

2022年4月21日,NBA项目方遭遇黑客攻击。

漏洞原因:签名冒用和复用

该漏洞存在于The_Association_Sales合约中,项目当在采用签名校验的方式验证白名单时,主要存在两个安全问题:签名冒用和签名复用。其中签名复用问题是由于项目方并未在合约中存储已经使用过的签名,造成签名可以被攻击者重复多次使用;签名冒用的问题是由于vData memory参数info在传参时未进行msg.sender校验导致签名可冒用。

Akutar事件

2022年4月23日,NFT项目方Akutar的AkuAuction合约由于智能合约本身漏洞,导致11539ETH(价值约3400万美元)被锁死在合约中。

扩展阅读:NFT项目惊现低级漏洞,合约未审计导致3400万美元资产被锁死 ——Akutar事件分析

漏洞原因:逻辑漏洞

该合约存在两个逻辑漏洞,第一是退款函数processRefunds使用call函数进行退款操作,并且把退款结果作为require判定条件,如果攻击者在fallback中进行恶意revert会导致整个合约的退款操作无法继续进行。第二个漏洞是造成此次事件的根本原因,即退款函数中存在的两个判断条件,由于没有考虑到一个用户可以投标多个NFT的情况,使得项目方后续的退款操作永远无法执行。

XCarnival事件

2022年6月24日,NFT 借贷协议 XCarnival 遭到攻击,黑客获利 3087 枚以太坊(约 380 万美元)。

扩展阅读:NFT 借贷平台需警惕,XCarnival被攻击事件给我们哪些启示?

漏洞原因:逻辑漏洞

该漏洞存在于XNFT合约中,该合约中的pledgeAndBorrow 函数在质押NFT时并未未检查攻击者传入的xToken地址是否为项目方白名单中的地址;并且在借贷时,并未对抵押记录的状态进行检测,导致攻击者反复使用无效的抵押记录进行借贷。

3、NFT合约在审计过程中都会出现哪些常见问题呢

上半年发生了多起NFT合约相关的安全事件,主要原因还是没有进行全面的安全审计,那么NFT合约在审计过程中都会出现哪些常见问题呢?

成都链安审计团队在审计NFT系列合约时,发现NFT合约主要的问题包括以下几类:

(1)签名冒用和复用:

签名数据缺少重复执行验证(例如:缺少用户nonce),导致可以重复使用签名数据铸造NFT;

签名检查不合理(例如:未检查签名者为零地址的情况),导致任意用户均可通过检查进行铸币;

(2) 逻辑漏洞:

合约管理员可以通过私募等特殊方式铸币而不受总量的限制,导致NFT的实际量超过预期;

拍卖NFT时,获胜者可在领取交易顺序依赖攻击,修改竞拍价格,导致竞拍获胜者可以低价获取NFT;

(3) ERC721&ERC1155重入攻击

当合约使用转账通知功能时(onERC721Received函数),NFT合约会主动向转账的目标合约发送一次调用,那么这就可能导致重入攻击;

(4) 授权范围过大

用户在进行质押或者拍卖时,仅需要对单个代币授权,但合约要求_operatorApprovals授权,一旦用户授权成功,那么就存在NFT被盗的风险。

(5) 价格操控

NFT的价格依赖于某合约的代币持有量,导致攻击者利用闪电贷拉高代币价格,使得质押的NFT被异常清算。

从上半年发生的NFT合约安全事件来看,审计过程中经常出现的漏洞在实际中也会被黑客利用。因此寻求专业的安全公司对NFT合约进行审计也是非常有必要的。

Пов'язані матеріали

Micron Shuts Up the Bears, Makes India's 'Buffett' Regret: Sold Too Early, Missed Out on $2 Billion

Indian value investor Mohnish Pabrai, a disciple of Warren Buffett, revealed his costly mistake of selling shares in Micron Technology too early. He initially invested in 2017, holding it for six years and building a position as large as 77% of his portfolio, based on a thesis that the memory chip industry would consolidate into a stable oligopoly of Samsung, SK Hynix, and Micron. However, he sold his entire stake in September 2023, fearing oversupply after Samsung announced production expansion. Shortly after his exit, demand for high-bandwidth memory (HBM) surged with the rise of AI, and Micron's stock price skyrocketed over 15 times in two years. Pabrai estimates this premature sale cost him roughly $20 billion in potential gains. He expressed similar regret over selling his investment in SK Hynix too soon, stating he violated his own principle of holding companies forever. Reflecting on these errors, Pabrai emphasized his core investment checklist principles: avoiding leverage, focusing on the durability of a company's competitive moat, and assessing management's character. Despite these personal trading missteps, his long-term view on the remaining memory chip leaders remains bullish, advising current holders not to sell as "the party is just getting started." He concluded by sharing his philosophical outlook, prioritizing character over wealth, and his goal to donate his entire fortune before his passing.

marsbit3 хв тому

Micron Shuts Up the Bears, Makes India's 'Buffett' Regret: Sold Too Early, Missed Out on $2 Billion

marsbit3 хв тому

Mihoyo's Next Protagonist Is Her, Who Plays the Piano

Mihoyo, widely recognized for its hit game Genshin Impact, has long harbored a grander ambition: creating a virtual world where one billion people would want to live. While its character design is unparalleled, the company recognizes a fundamental limitation—these beloved virtual characters are not truly "alive." Their dialogue and actions are pre-scripted. This drive for authentic "living" characters has guided Mihoyo's strategic investments in cutting-edge fields like brain-computer interfaces, AI (including an early investment in MiniMax), and nuclear fusion. Following the release of ChatGPT in late 2022, co-founder Cai Haoyu stepped down from management to lead a new overseas AI venture, Anuttacon, focused on creating AI-driven virtual beings. Mihoyo's path has involved experimentation and iteration. Anuttacon's early project, *Whisper of the Stars*, showcased real-time AI conversation but revealed limitations in underlying language models. The team subsequently focused its resources on developing a sophisticated "emotional" large language model, distinct from purely utilitarian AI. Co-founder Liu Wei (Dawei) announced plans to invest up to 100 billion RMB in this AI pursuit. The first tangible product of this vision is *BSide: Olivia Lin*, a free Steam application featuring a piano-playing virtual companion. Unlike typical AI chatbots demanding constant interaction, Olivia Lin operates on a slower, more deliberate rhythm—responding to letters, playing user-submitted melodies, and serving as a desktop presence. This design emphasizes "lifelikeness" over exhaustive conversation, strategically working around current technological constraints while building a sense of authentic connection. The company's journey traces back to its name, "miHoYo," where "mi" pays homage to the virtual singer Hatsune Miku. For nearly two decades, fans have loved Miku, a character unaware of their devotion. Mihoyo's ultimate goal, now backed by massive investment and AI research, is to bridge that gap—to create virtual beings that can truly know they are loved.

marsbit21 хв тому

Mihoyo's Next Protagonist Is Her, Who Plays the Piano

marsbit21 хв тому

Citrini Research: Taking Stock of 5 Major Investment Themes Overshadowed by the AI Trade

Citrini Research identifies five under-the-radar investment themes potentially overshadowed by the dominant AI trade. With capital and analyst attention overwhelmingly focused on AI infrastructure, these overlooked areas present alpha opportunities as market dynamics shift. **Theme 1: Airlines** – Despite strong fundamentals, stocks like Delta and United have been penalized for 18 months due to macro concerns (tariff-inflation, oil prices), not profitability. A rebound is expected as these headwinds fade, aided by trends like premiumization and the 2026 World Cup. **Theme 2: Senior Housing** – A pure demographic play. The U.S. population over 80 is projected to grow 56% in the next decade, drastically outpacing supply. This creates a compelling need for facilities, benefiting REITs like Welltower and operators like Brookdale. **Theme 3: Live Events & Entertainment** – "Being there" is becoming a luxury. This sector has outperformed even tech over the past decade. Companies like TKO Group (WWE/UFC), Cinemark, and IMAX are capitalizing on demand for premium, in-person experiences. **Theme 4: Exchange Competition** – CME Group's ~98% monopoly in U.S. interest rate derivatives faces its first real challenge from FMX Futures Exchange. Backed by major Wall Street banks, FMX offers lower fees and margin savings. While CME's deep liquidity remains an advantage, FMX provides a competitive alternative. **Theme 5: Fintech Recovery** – Heavily sold off in 2026, fintech stocks like SoFi, Robinhood, and Upstart are showing signs of a rebound based on improving fundamentals—SoFi's stablecoin launch, Robinhood's transformation into a "financial super app," and Upstart's renewed AI lending narrative—rather than a change in sector outlook. The report advises maintaining some AI exposure but diversifying into these neglected "small themes" where mispricing exists due to a simple shortage of investor attention.

marsbit56 хв тому

Citrini Research: Taking Stock of 5 Major Investment Themes Overshadowed by the AI Trade

marsbit56 хв тому

21Shares Mid-Year Key Report: Bitcoin's Four-Year Cycle Remains Intact, Stablecoins and Tokenization Emerge as New Growth Engines

21Shares Mid-Year Report 2026: Bitcoin Cycle Intact, Stablecoins & Tokenization Emerge as New Engines This mid-year review assesses progress against 21Shares' ten predictions for 2026. While the overarching shift from narrative to fundamentals holds, performance varies. Key findings show Bitcoin's four-year cycle remains evident despite market maturation. Global crypto ETP AUM has declined to ~$140B, lagging the $400B target, though product innovation continues. Stablecoin supply surpassed $320B, demonstrating non-cyclical demand but falling short of the $1T forecast due to slower regulatory clarity. DeFi TVL, stalled at ~$140B, was hindered by major security incidents. Corporate crypto treasuries hold ~1.28M BTC ($100B), with consolidation pressuring weaker players. Prediction markets are on track, with $57.5B volume already surpassing half the $100B annual target. AI agent infrastructure is ready, but adoption is early. Ethereum L2 consolidation is underway, with the top 5 capturing nearly 90% of activity. Compliant token launches have a platform but lack mainstream volume. Tokenized RWAs total ~$31B on public chains, but institutional pipeline growth is strong. In summary, fundamentals like stablecoins, tokenization, and prediction markets are advancing, but targets require faster adoption or price appreciation. The market is maturing, yet cyclical patterns persist.

marsbit1 год тому

21Shares Mid-Year Key Report: Bitcoin's Four-Year Cycle Remains Intact, Stablecoins and Tokenization Emerge as New Growth Engines

marsbit1 год тому

Торгівля

Спот
Ф'ючерси
活动图片