The RAACNFT contract's refund mechanism contains a potential issue where users minting NFTs could receive incorrect refund amounts.
When users mint real estate NFTs, they can overpay and receive incorrect refund amounts, potentially draining protocol funds through precision manipulation. Notice how the RAAC protocol handles real estate tokenization, users mint NFTs by paying RAAC tokens based on house prices from the oracle. The mistake is in the refund mechanism. When Alice wants to mint an NFT worth 100 RAAC tokens but sends 150 tokens, she should receive exactly 50 tokens back. However, the current implementation fails to properly validate this mathematical relationship.
The issue manifests in the interaction between RAACNFT.sol and RAACHousePrices.sol. Here's what happens: RAACNFT.sol#mint
We can see the vulnerability lies in the refund calculation section where the contract:
Accepts any overpayment amount without upper bounds
Performs unchecked subtraction for refund calculation
Sends refund without validating the mathematical relationship between price, payment, and refund
This creates a direct path for potential token extraction through carefully crafted input values.
This means that refund calculation relies entirely on the difference between sent amount and house price, without additional safeguards. An attacker could manipulate these values to extract more tokens than they should receive.
When users mint NFTs representing real estate, they interact with two key components, the RAACNFT contract and the RAACHousePrices oracle. This means that every minting operation involves a complex dance of price verification, token transfers, and refund calculations. The current implementation creates a gap between these steps that could lead to incorrect refund amounts.
The RAACHousePrices oracle provides the fundamental price feed that determines NFT values. When Alice overpays for an NFT, the protocol should return exactly the difference between her payment and the house price. However, the unchecked refund calculation in the mint function creates a vulnerability in this core economic mechanism.
This vulnerability directly affects the protocol's ability to maintain accurate real estate value representation on-chain. Think of it as a real estate transaction where the escrow system occasionally returns more money than the overpayment amount, yyou see this breaks the fundamental trust in the tokenization process.
Implement proper validation while maintaining the protocol's elegant simplicity. By adding maximum overpayment limits and strict refund validation, we can preserve the core functionality while preventing potential economic exploits.
The vulnerability exists in the interaction between these contracts:
RAACNFT.sol relies on RAACHousePrices.sol for pricing
IRAACHousePrices.sol defines the interface for price lookups
The refund calculation happens entirely in RAACNFT.sol without additional validation from RAACHousePrices.sol
Secure implementation would add:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.