DeFiFoundrySolidity
16,653 OP
View results
Submission Details
Severity: medium
Invalid

Missing Validation for Underlying Token in Strategy Initialization

Summary

The strategyMainnet.sol contract fails to validate that the underlying token returned by the transmuter contract matches the expected WETH address. This missing validation introduces vulnerabilities and risks, such as failed swaps, security exploits, or misconfigurations, leading to potential financial losses.
In the constructor:

The underlying token is assigned as:

underlying = ERC20(transmuter.underlyingToken());

The underlyingToken of the transmuter contract determines the underlying token address.
There is no explicit validation to ensure that the underlying token is what the protocol expects (e.g., WETH).
The syntheticToken of the transmuter is validated against _asset:

require(transmuter.syntheticToken() == _asset, "Asset does not match transmuter synthetic token");

This ensures the synthetic token in transmuter matches _asset.
However, no similar validation is applied to the underlying token.

Vulnerability Details

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyMainnet.sol#L27C5-L38C6

The issue exists in the constructor of strategyMainnet.sol:

underlying = ERC20(transmuter.underlyingToken());

The underlying token is set directly using the value returned by the transmuter.underlyingToken().
No explicit validation is performed to ensure that this token matches the expected WETH address.
The protocol assumes that the underlying token returned by the transmuter contract is always WETH. However, this assumption is not enforced programmatically, leaving the system vulnerable to misconfiguration of the transmuter contract and potential exploitation by malicious actors using a rogue transmuter contract.

Impact

  1. Swaps May Fail or Misbehave. If the underlying is not WETH, swaps on Curve could fail, misroute, or result in significant financial loss due to incorrect token handling.

  2. Failed token transfers because any logic assuming the underlying token is WETH (e.g., swap parameters, pricing assumptions, etc.) will be incorrect.

  3. If transmuter.underlyingToken() points to an unexpected or malicious token, attackers might exploit this by draining funds.

Tools Used

Vscode, Manual analysis

Recommendations

Add a validation step in the constructor to ensure that the underlying token returned by transmuter.underlyingToken() matches the canonical WETH address.

Updates

Appeal created

inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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