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

borrowingFee is not initialized #47

Closed
code423n4 opened this issue Jun 2, 2021 · 1 comment
Closed

borrowingFee is not initialized #47

code423n4 opened this issue Jun 2, 2021 · 1 comment
Labels

Comments

@code423n4
Copy link
Contributor

Handle

0xRajeev

Vulnerability details

Impact

borrowingFee not initialized (defaults to 0) at declaration and depends on setFee() for a non-zero acceptable value.

It is safer to initialize at declaration to a non-zero default otherwise borrowers can borrow for zero fees.

Proof of Concept

https://github.com/code-423n4/2021-05-yield/blob/e4c8491cd7bfa5dc1b59eb1b257161cd5bf8c6b0/contracts/LadleStorage.sol#L37

https://github.com/code-423n4/2021-05-yield/blob/e4c8491cd7bfa5dc1b59eb1b257161cd5bf8c6b0/contracts/Ladle.sol#L304

https://github.com/code-423n4/2021-05-yield/blob/e4c8491cd7bfa5dc1b59eb1b257161cd5bf8c6b0/contracts/Ladle.sol#L438

https://github.com/code-423n4/2021-05-yield/blob/e4c8491cd7bfa5dc1b59eb1b257161cd5bf8c6b0/contracts/Ladle.sol#L105-L112

Tools Used

Manual Analysis

Recommended Mitigation Steps

  1. Initialize borrowingFee at declaration to a non-zero default
  2. Add a threshold check for the same in setFee()
@code423n4 code423n4 added 1 (Low Risk) bug Something isn't working labels Jun 2, 2021
code423n4 added a commit that referenced this issue Jun 2, 2021
@alcueca
Copy link
Collaborator

alcueca commented Jun 2, 2021

We intend to go live with zero fee borrowing.

@dmvt dmvt closed this as completed Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants