CPI Reentrancy Is Back: A Solana Developer's Defense Playbook for Token-2022 Transfer Hooks

For years, Solana developers enjoyed a comforting belief: reentrancy isn't a thing here. The runtime's single-threaded execution model and account locking semantics meant the recursive callback att...

By · · 1 min read
CPI Reentrancy Is Back: A Solana Developer's Defense Playbook for Token-2022 Transfer Hooks

Source: DEV Community

For years, Solana developers enjoyed a comforting belief: reentrancy isn't a thing here. The runtime's single-threaded execution model and account locking semantics meant the recursive callback attacks that plagued Ethereum simply couldn't happen. Token-2022 transfer hooks changed that. When you call transfer_checked on a Token-2022 mint that has a transfer hook configured, the Token-2022 program will CPI into the hook program — which could be anything. That hook can then CPI back into your program before your function has finished updating state. Classic reentrancy, reborn on Solana. This isn't theoretical. The Neodyme security team demonstrated practical exploit paths in their Token-2022 security analysis, and every DeFi protocol accepting Token-2022 tokens is a potential target. Here's the defensive playbook. The Attack Anatomy Consider a lending protocol's deposit() function: pub fn deposit(ctx: Context<Deposit>, amount: u64) -> Result<()> { // 1. Transfer tokens fro

Related Posts

Similar Topics

#sol (407)#sol price (216)#vulnerability research (226)#sol news (165)#supply chain security (138)#featured (220)#technology (210)#github security lab (185)#defi (127)#ethereum (122)#ai (120)#solusd (59)#application security (100)#crypto (100)#opinion (98)#xrp (66)#bitcoin (74)#guest post (70)#blockchain (49)#tokenization (57)

Trending on ShareHub

  1. Understanding Modern JavaScript Frameworks in 2026
    by Alex Chen · Feb 12, 2026 · 0 likes
  2. The System Design Primer
    by Sarah Kim · Feb 12, 2026 · 0 likes
  3. Just shipped my first open-source project!
    by Alex Chen · Feb 12, 2026 · 0 likes
  4. OpenAI Blog
    by Sarah Kim · Feb 12, 2026 · 0 likes
  5. Building Accessible Web Applications: A Practical Guide
    by Alex Chen · Feb 12, 2026 · 0 likes
  6. Rapper Lil Poppa dead at 25, days after releasing new music
    Rapper Lil Poppa dead at 25, days after releasing new music
    by Anonymous User · Feb 19, 2026 · 0 likes
  7. write-for-us
    by Volt Raven · Mar 7, 2026 · 0 likes
  8. Before the Coffee Gets Cold: Heartfelt Story of Time Travel and Second Chances
    Before the Coffee Gets Cold: Heartfelt Story of Time Travel and Second Chances
    by Anonymous User · Feb 12, 2026 · 0 likes
    #coffee gets cold #the #time travel
  9. Best DoorDash Promo Code Reddit Finds for Top Discounts
    Best DoorDash Promo Code Reddit Finds for Top Discounts
    by Anonymous User · Feb 12, 2026 · 0 likes
    #doordash #promo #reddit
  10. Premium SEO Services That Boost Rankings & Revenue | VirtualSEO.Expert
    by Anonymous User · Feb 12, 2026 · 0 likes
  11. NBC under fire for commentary about Team USA women's hockey team
    NBC under fire for commentary about Team USA women's hockey team
    by Anonymous User · Feb 18, 2026 · 0 likes
  12. Where to Watch The Nanny: Streaming and Online Viewing Options
    Where to Watch The Nanny: Streaming and Online Viewing Options
    by Anonymous User · Feb 12, 2026 · 0 likes
    #streaming #the nanny #where
  13. How Much Is Kindle Unlimited? Subscription Cost and Plan Details
    How Much Is Kindle Unlimited? Subscription Cost and Plan Details
    by Anonymous User · Feb 12, 2026 · 0 likes
    #kindle unlimited #subscription #unlimited
  14. Russian skater facing backlash for comment about Amber Glenn
    Russian skater facing backlash for comment about Amber Glenn
    by Anonymous User · Feb 18, 2026 · 0 likes
  15. Google News
    Google News
    by Anonymous User · Feb 18, 2026 · 0 likes

Latest on ShareHub

Browse Topics

#artificial intelligence (31562)#data science (24018)#ai (17071)#generative ai (15034)#crypto (15000)#machine learning (14681)#bitcoin (14247)#featured (13561)#news & insights (13064)#crypto news (11085)

Around the Network