RemoteAddressValidator
can incorrectly convert addresses to lower case
#323
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
M-03
primary issue
Highest quality submission among a set of duplicates
selected for report
This submission will be included/highlighted in the audit report
Lines of code
https://github.com/code-423n4/2023-07-axelar/blob/2f9b234bb8222d5fbe934beafede56bfb4522641/contracts/its/remote-address-validator/RemoteAddressValidator.sol#L58
Vulnerability details
Impact
The
validateSender
andaddTrustedAddress
functions ofRemoteAddressValidator
can incorrectly handle the passed address arguments, which will result in false negatives. E.g. a valid sender address may be invalidated.Proof of Concept
The RemoteAddressValidator._lowerCase function is used to convert an address to lower case. Since the protocol is expected to support different EVM and non-EVM chains, account addresses may have different format, thus the necessity to convert them to strings and to convert the strings to lower case when comparing them. However, the function only converts the hexadecimal letters, i.e. the characters in ranges A-F:
Here,
65
corresponds toA
, and70
corresponds toF
. But, since different EVM and non-EVM chains are supported, addresses can contain other characters. For example, Cosmos uses bech32 addresses and Evmos supports both hexadecimal and bech32 addresses.If not all alphabetical characters of an address are converted to lower case, then the address comparison in the validateSender can fail and result in a false revert.
Tools Used
Manual review
Recommended Mitigation Steps
In the
_lowerCase
function, consider converting all alphabetical characters to lower case, e.g.:Assessed type
Other
The text was updated successfully, but these errors were encountered: