Skip to content

L-2: EmergencyBurn still wedges on present-but-undecodable escrowed portfolio (#110B) #162

Description

@v1ktorrr0x

Bug

The #131 portfolio_gone escape hatch only fires for data_is_empty() || lamports() == 0 (processor.rs:1017). A wrapper-owned portfolio that is still funded/non-empty but fails decode_portfolio (e.g., a future layout migration flips magic/version/discriminator) takes the else branch → verify_portfolio_program + decode_portfolioPortfolioDecodeFailedEmergencyBurn reverts forever.

The NFT, its rent, and the escrowed position are all stranded.

Source Impact

This is the explicitly deferred #110B (README.md:131-135). It's coupled to M-1: a silent layout drift (M-1) is precisely what would make a live portfolio "undecodable."

Risk

  • Rent lockup: NFT holder can't reclaim ~0.02 SOL per stranded NFT
  • Escrow lockup: position remains escrowed to the NFT program's PDA forever, inaccessible even via direct portfolio operations
  • Requires abnormal core state (modified magic/version), so low-severity, but high-impact when it happens

Fix

Add a graceful fallback path in EmergencyBurn: if the portfolio fails decode, skip the eligibility check and just proceed with burning the NFT + closing accounts. The position was already escrowed and can't be modified anyway; the holder just wants their rent back.

Labels: security, deferred

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions