A low-severity vulnerability was identified in the use of abi.encodePacked()
for generating the symbols of wTokens. Although the current impact is limited, this practice could pose risks if the code is modified in the future.
The contract uses abi.encodePacked()
to concatenate strings when creating the symbols of wTokens. This method is susceptible to creating hash collisions if used with dynamic strings.
PoC:
The PoC test demonstrates that different symbols can produce identical results when using abi.encodePacked()
.
Severity: Low
The current impact is minimal because:
The result is not used in a hash function
The symbols are only used for display purposes
The wTokens are mapped to their original tokens via their addresses, not their symbols
No critical logic depends on these values
Hardhat unit tests
Custom PoC demonstrating the potential collision
Manual code review
Replace abi.encodePacked()
with bytes.concat()
for string concatenation:
Alternative: Use abi.encode()
if the result needs to be used in a hash function in the future:
These modifications will prevent potential collisions and follow best practices for Solidity development.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.