Closed code423n4 closed 1 year ago
What is the issue if the name of the vault is defined as "AST-Vault-" + the underlying token symbol? This is just a matter of convention, especially as names aren't suppose to be unique or anything.
Picodes marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-01-astaria/blob/main/src/Vault.sol#L28-L36 https://github.com/code-423n4/2023-01-astaria/blob/main/src/WithdrawProxy.sol#L103-L111 https://github.com/code-423n4/2023-01-astaria/blob/main/src/PublicVault.sol#L76-L84
Vulnerability details
Impact
In Vault.sol, WithdrawProxy.sol and PublicVault.sol,
name()
is making an incorrect external call to return its output variable. Apparently, it is callingERC20(asset()).symbol())
instead ofERC20(asset()).name())
. Devoid of an accurate name description, this could lead to confusion and perhaps trick users/developers into mistaking it for another asset.Proof of Concept
The following instances show the wrong inclusion of the second variable in
string(abi.encodePacked()
:Vault.sol#L28-L36
WithdrawProxy.sol#L103-L111
PublicVault.sol#L76-L84
Recommended Mitigation Steps
It is recommended replacing
ERC20(asset()).symbol())
withERC20(asset()).name())
in the return statement to clear up the errors.