Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tokens can be sent directly #265

Closed
code423n4 opened this issue Dec 19, 2021 · 1 comment
Closed

Tokens can be sent directly #265

code423n4 opened this issue Dec 19, 2021 · 1 comment
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 duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Handle

pauliax

Vulnerability details

Impact

Token join contracts check that the final outputAmount is equal to _joinTokenStruct.outputAmount:

  uint256 outputAmount = outputToken.balanceOf(address(this));
  require(
      outputAmount == _joinTokenStruct.outputAmount,
      "FAILED_OUTPUT_AMOUNT"
  );

While these contracts are only for convenience, a theoretical attack exists here: a malicious actor can monitor the mempool and send the smallest fraction of the output token (basket) directly to the contract thus breaking this check.

Recommended Mitigation Steps

Consider replacing == with >= .

@code423n4 code423n4 added 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working labels Dec 19, 2021
code423n4 added a commit that referenced this issue Dec 19, 2021
@loki-sama loki-sama added the duplicate This issue or pull request already exists label Jan 3, 2022
@loki-sama
Copy link
Collaborator

duplicate #81

@ghost ghost closed this as completed Jan 10, 2022
@0xleastwood 0xleastwood added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value and removed 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments labels Jan 18, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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 duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants