Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OxTushar - No Validation of NFT Ownership or veAERO Validity in the Deposit Function of Receipt-veNFT Contract #1006

Open
sherlock-admin2 opened this issue Nov 25, 2024 · 0 comments

Comments

@sherlock-admin2
Copy link

sherlock-admin2 commented Nov 25, 2024

OxTushar

High

No Validation of NFT Ownership or veAERO Validity in the Deposit Function of Receipt-veNFT Contract

Summary

The deposit function in the Receipt-veNFT contract lacks proper validation to ensure that the NFT being deposited is owned by the user or corresponds to a valid veAERO.
https://github.com/sherlock-audit/2024-11-debita-finance-v3/blob/main/Debita-V3-Contracts/contracts/Non-Fungible-Receipts/veNFTS/Aerodrome/Receipt-veNFT.sol#L63

This oversight allows malicious users to deposit any random NFT, bypassing the intended logic of the protocol.

Root Cause

The deposit function does not verify whether the caller owns the NFT being deposited or whether the NFT is a valid veAERO. Without this check, users can deposit unrelated or invalid NFTs, potentially leading to protocol abuse or incorrect collateral calculations.

https://github.com/sherlock-audit/2024-11-debita-finance-v3/blob/main/Debita-V3-Contracts/contracts/Non-Fungible-Receipts/veNFTS/Aerodrome/Receipt-veNFT.sol#L63

  1. No Ownership Validation:
    • The contract does not check if msg.sender is the actual owner of tokenId before calling transferFrom.
  2. No veAERO Validity Check:
    • The function does not verify if the tokenId corresponds to a valid veAERO.

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

Malicious users can deposit invalid NFTs, bypassing the requirement for legitimate assets.
This may lead to the issuance of rewards, incentives, or benefits based on fraudulent deposits.

PoC

No response

Mitigation

Verify that the tokenId belongs to the valid set of veAERO NFTs
Before calling transferFrom, ensure the caller owns the tokenId:

@sherlock-admin3 sherlock-admin3 changed the title Sunny Pewter Kookaburra - No Validation of NFT Ownership or veAERO Validity in the Deposit Function of Receipt-veNFT Contract OxTushar - No Validation of NFT Ownership or veAERO Validity in the Deposit Function of Receipt-veNFT Contract Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant