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

updateExchangeRate has no validation result #316

Closed
code423n4 opened this issue Jul 24, 2023 · 8 comments
Closed

updateExchangeRate has no validation result #316

code423n4 opened this issue Jul 24, 2023 · 8 comments
Labels
bug Something isn't working disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) downgraded by judge Judge downgraded the risk level of this issue edited-by-warden grade-b low quality report This report is of especially low quality primary issue Highest quality submission among a set of duplicates QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

code423n4 commented Jul 24, 2023

Lines of code

https://github.com/Tapioca-DAO/tapioca-bar-audit/blob/2286f80f928f41c8bc189d0657d74ba83286c668/contracts/markets/singularity/Singularity.sol#L119
https://github.com/Tapioca-DAO/tapioca-bar-audit/blob/2286f80f928f41c8bc189d0657d74ba83286c668/contracts/markets/bigBang/BigBang.sol#L146

Vulnerability details

Impact

Will cause subsequent asset and share conversions to fail

Proof of Concept

For example, the calling path of borrow

call path

borrow->_computeAllowanceAmountInAsset->_computeMaxBorrowableAmount

In _computeMaxBorrowableAmount, exchangeRate is used as the denominator. If it is 0, the calculation cannot be performed normally. The exchangeRate defaults to 0, so it must be executed successfully during initialization, otherwise it will become a hidden problem after the system starts

Tools Used

Manual Review

Recommended Mitigation Steps

plus result verification

    (bool updated, )= updateExchangeRate();
    require(updated, "Market: invalid rate");

Assessed type

Invalid Validation

@code423n4 code423n4 added 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 labels Jul 24, 2023
code423n4 added a commit that referenced this issue Jul 24, 2023
@c4-pre-sort c4-pre-sort added the low quality report This report is of especially low quality label Aug 6, 2023
@c4-pre-sort
Copy link

minhquanym marked the issue as low quality report

@c4-pre-sort
Copy link

minhquanym marked the issue as primary issue

@minhquanym
Copy link
Member

Consider QA

@c4-sponsor c4-sponsor added the sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") label Aug 31, 2023
@c4-sponsor
Copy link

0xRektora (sponsor) confirmed

@c4-sponsor
Copy link

0xRektora marked the issue as disagree with severity

@c4-sponsor c4-sponsor added the disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) label Aug 31, 2023
@0xRektora
Copy link

Informational. If rate is 0, the Tx will revert, else a cached version will be used. https://github.com/Tapioca-DAO/tapioca-bar-audit/blob/2286f80f928f41c8bc189d0657d74ba83286c668/contracts/markets/Market.sol#L344

@c4-judge c4-judge added downgraded by judge Judge downgraded the risk level of this issue QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Sep 19, 2023
@c4-judge
Copy link

dmvt changed the severity to QA (Quality Assurance)

@c4-judge
Copy link

dmvt marked the issue as grade-b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) downgraded by judge Judge downgraded the risk level of this issue edited-by-warden grade-b low quality report This report is of especially low quality primary issue Highest quality submission among a set of duplicates QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

7 participants