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

block stuffing attack can make user stake gone #355

Closed
c4-bot-2 opened this issue Dec 23, 2023 · 9 comments
Closed

block stuffing attack can make user stake gone #355

c4-bot-2 opened this issue Dec 23, 2023 · 9 comments
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 downgraded by judge Judge downgraded the risk level of this issue duplicate-685 edited-by-warden insufficient quality report This report is not of sufficient quality partial-50 Incomplete articulation of vulnerability; eligible for partial credit only (50%)

Comments

@c4-bot-2
Copy link
Contributor

c4-bot-2 commented Dec 23, 2023

Lines of code

https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/loan/AuctionHouse.sol#L118-L161

Vulnerability details

Impact

gauge whale staking will be gone cause of block stuffing .

Proof of Concept

In auction , there is two phases ,In first one phase , auction house asked full credit for debt and offered collateral based on time passed . In second phase , auction house offer full collateral and reduced credit asked based on time passed .

ATTACK SCENARION

In first phase , auction house will send back some collateral to borrower for sure .If malicious borrower can make transaction revert , there will be no bid happen in first phase .To be reverted , malicious collateral is needed to call back to malicious borrower (malicious collateral must implement call back when transfer ). If malicious borrower can onboard lending term with that malicious collateral which has upgradable proxy , malicious borrower can make transaction revert that call back to him.

      function onBid(
    bytes32 loanId,
    address bidder,
    uint256 collateralToBorrower,
    uint256 collateralToBidder,
    uint256 creditFromBidder
) external {
   ..../
      //*@audit-info ------->>> user contract can make it revert
    if (collateralToBorrower != 0) {
        IERC20(params.collateralToken).safeTransfer(
            loans[loanId].borrower,
            collateralToBorrower
        );
    }
      }

In second phase , malicious user can do block stuffing for a few seconds, there will be loss incurred in notifyPnl , And notifyGaugeloss is also triggered ,This will cause user stake got slashed .

In case , gauge whale see that debt in auction and try to bit it , That's why implemented block stuffing for second phase .

In arbitrum , gas fee is really low and block stuffing is possible .
https://arxiv.org/pdf/2307.14773.pdf

This attack is really great when whales stake a lot of guage in that lending term .

Tools Used

manual view

Recommended Mitigation Steps

partial slashing is best way i guess , not all weight slashing

Assessed type

DoS

@c4-bot-2 c4-bot-2 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Dec 23, 2023
c4-bot-8 added a commit that referenced this issue Dec 23, 2023
@0xSorryNotSorry
Copy link

The submission does not provide any demonstration of the issue, reasoning and code blocks.

@c4-pre-sort
Copy link

0xSorryNotSorry marked the issue as insufficient quality report

@c4-pre-sort c4-pre-sort added the insufficient quality report This report is not of sufficient quality label Jan 2, 2024
@c4-judge
Copy link
Contributor

Trumpero marked the issue as unsatisfactory:
Insufficient quality

@c4-judge c4-judge added the unsatisfactory does not satisfy C4 submission criteria; not eligible for awards label Jan 24, 2024
@irving4444
Copy link

@Trumpero Could you pls check this report again?I did mention malicious collateral that will call back to attacker during first phase to revert the transaction and for second phase ,block stuffing attack will be happen . This report is also almost same as #685 .

@Trumpero
Copy link

Trumpero commented Feb 8, 2024

@irving4444 Agree that this should be a dup of #685, but should receive only 50% partial credit due to the lack of quality.

@c4-judge
Copy link
Contributor

c4-judge commented Feb 8, 2024

Trumpero marked the issue as duplicate of #685

@c4-judge c4-judge added satisfactory satisfies C4 submission criteria; eligible for awards and removed unsatisfactory does not satisfy C4 submission criteria; not eligible for awards labels Feb 8, 2024
@c4-judge
Copy link
Contributor

c4-judge commented Feb 8, 2024

Trumpero marked the issue as satisfactory

@c4-judge
Copy link
Contributor

c4-judge commented Feb 8, 2024

Trumpero marked the issue as partial-50

@c4-judge c4-judge added partial-50 Incomplete articulation of vulnerability; eligible for partial credit only (50%) 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value downgraded by judge Judge downgraded the risk level of this issue and removed satisfactory satisfies C4 submission criteria; eligible for awards 3 (High Risk) Assets can be stolen/lost/compromised directly labels Feb 8, 2024
@c4-judge
Copy link
Contributor

c4-judge commented Feb 8, 2024

Trumpero changed the severity to 2 (Med Risk)

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 downgraded by judge Judge downgraded the risk level of this issue duplicate-685 edited-by-warden insufficient quality report This report is not of sufficient quality partial-50 Incomplete articulation of vulnerability; eligible for partial credit only (50%)
Projects
None yet
Development

No branches or pull requests

7 participants