Closed code423n4 closed 2 years ago
Finding doesn't have code / POC but is going for a High Severity
Without an exploration of the potential impact here as it relates to Nibbl or a POC, this is QA type feedback. Merging with the warden's QA report #264
Lines of code
https://github.com/code-423n4/2022-06-nibbl/blob/8c3dbd6adf350f35c58b31723d42117765644110/contracts/Twav/Twav.sol#L12
Vulnerability details
Description
The window of TWAV is only 4 blocks, which is only 1 minute on Ethereum. Many layer-2 blockchains even have a much shorter block time. Attackers can easily manipulate the value.
We have seen a lot of hacks regarding to the short window in the wild, some typical ones are cited as follows.
Suggested Fix
Increase the window size.