F-2024-0001·missing-validation

Lack of critical check on nearTokenId in newBridgeToken function

Fixedbridgenearrainbow-bridgegithub.com/Near-One/rainbow-token-connector
TL;DR

newBridgeToken does not validate that the nearTokenId argument equals result.token, allowing an attacker to register an incorrect nearTokenId and cause deposit and withdraw to always revert (DoS).

Severity
MEDIUM
Impact
MEDIUM
Likelihood
MEDIUM
Method
MManual review
CAT.
Complexity
LOW
Exploitability
MEDIUM
02Section · Description

Description

The newBridgeToken function lacks a critical validation check for the nearTokenId argument. This argument should be required to equal result.token. The absence of this check allows any user to submit a metadata proof with an incorrect nearTokenId. As a result, the legitimate token ID will not be recognized in the _nearToEthToken and _isBridgeToken mappings. This causes the deposit and withdraw functions to always revert, effectively creating a Denial of Service (DoS) situation for these token functionalities.

03Section · Impact

Impact

The missing check on the nearTokenId argument can lead to a Denial of Service (DoS) attack. An attacker can submit a metadata proof with an incorrect nearTokenId, causing the deposit and withdraw functionalities to always revert. This is because the correct nearTokenId will not be found in the _nearToEthToken and _isBridgeToken mappings.

04Section · Recommendation

Recommendation

Add a validation check in the newBridgeToken function to ensure that the nearTokenId argument equals result.token. This will prevent users from submitting incorrect nearTokenId values and ensure that only legitimate token IDs are recognized in the mappings. Another fix is using result.token directly and removing the _nearToEthToken argument.

05Section · Resolution

Resolution

Resolved.

Status
Fixed
F-2024-0001

oog
zealynx

Smart Contract Security Digest

Monthly exploit breakdowns, audit checklists, and DeFi security research — straight to your inbox

© 2026 Zealynx