stake.link

stake.link
DeFiHardhatBridge
27,500 USDC
View results
Submission Details
Severity: low
Valid

getLockIdsByOwner gas cost can be exploited by malicious agent

Summary

'getLockIdsByOwner' uses array structure and maxLockId to match lockId and lock owner. By spamming/creating locks with value of 1 the attacker can increase gas cost of 'getLockIdsByOwner' significantly, which, while being a "view" function can be used elsewhere is dependencies.

Vulnerability Details

Impact

MEDIUM

Tools Used

Manual review

Recommendations

Change iteration to mapping/array data structure, where key would be owner address and array contents are lockIds.

Updates

Lead Judging Commences

0kage Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

unbounded-locks

getLockIdsByOwner could be very gas intensive and revert

Support

FAQs

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