NFTBridge
60,000 USDC
View results
Submission Details
Severity: low
Invalid

[M-3] Access control issue in `escrow_deposit_tokens()` in `bridge.cairo`

Summary

The `escrow_deposit_tokens` function in the bridge.cairo currently lacks proper access control mechanisms, allowing any user to call the function. This oversight presents several risks, including unauthorized deposits, potential exploitation by malicious actors, lack of accountability, and possible regulatory non-compliance.

Vulnerability Details

Vulnerability Type: Improper Access Control (Function Misuse)
The escrow_deposit_tokens function can be invoked by any external address. This lack of restriction means that the function does not check whether the caller has the necessary permissions or authorization to perform the deposit action. As a result, this opens up several avenues for exploitation:

Unauthorized Deposits: Any user can deposit tokens on behalf of another user without their consent or knowledge.
Spam and DoS Attacks: The function can be spammed with unauthorized or unnecessary transactions, potentially leading to network congestion and increased gas fees.
Economic Manipulation: Malicious actors could exploit the function to manipulate the token supply or escrow conditions, leading to unintended economic outcomes.

Code :

fn escrow_deposit_tokens(
ref self: ContractState,
contract_address: ContractAddress,
from: ContractAddress,
token_ids: Span<u256>,
) {
let to = starknet::get_contract_address(); // getiing self address as the escrow address
// Getting an instance from the that address
let erc721 = IERC721Dispatcher { contract_address };

Impact

Severity: High

Likelihood: Medium to High

Recommendations

Implementat access control here, or make the function internal, allowing the only bridge to call this function.

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational / Gas

Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.