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

Attacker can delay proposal rejection #24

Open
code423n4 opened this issue Dec 19, 2022 · 6 comments
Open

Attacker can delay proposal rejection #24

code423n4 opened this issue Dec 19, 2022 · 6 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 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 M-02 primary issue Highest quality submission among a set of duplicates selected for report This submission will be included/highlighted in the audit report

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-12-tessera/blob/f37a11407da2af844bbfe868e1422e3665a5f8e4/src/seaport/modules/OptimisticListingSeaport.sol#L145

Vulnerability details

Impact

In OptimisticListingSeaport.rejectProposal, it revert if proposedListing.collateral < _amount. An attacker can therefore monitor the mempool, reducing the proposedListing.collateral to _amount - 1 by frontruning the rejectProposal call and delay the rejection. The attacker may even be able to deny the rejection when the deadline passes.

https://github.com/code-423n4/2022-12-tessera/blob/f37a11407da2af844bbfe868e1422e3665a5f8e4/src/seaport/modules/OptimisticListingSeaport.sol#L145

        if (proposedListing.collateral < _amount) revert InsufficientCollateral();

https://github.com/code-423n4/2022-12-tessera/blob/f37a11407da2af844bbfe868e1422e3665a5f8e4/src/seaport/modules/OptimisticListingSeaport.sol#L153

        proposedListing.collateral -= _amount;

Proof of Concept

  1. Attacker propose at 10000 collateral at a very low price
  2. Bob try to reject it by purchasing the 10000 collateral
  3. Attacker see Bob's tx in the mempool, frontrun it to reject 1 unit
  4. The proposedListing.collateral is now 9999
  5. Bob's call reverted
  6. This keep happening until PROPOSAL_PERIOD pass or Bob gave up because of gas paid on failing tx
  7. Attacker buy the NFT at a very low price

Recommended Mitigation Steps

When proposedListing.collateral < _amount, set _amount to proposedListing.collateral and refund the excess.

@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Dec 19, 2022
code423n4 added a commit that referenced this issue Dec 19, 2022
@c4-sponsor c4-sponsor added the disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) label Jan 4, 2023
@c4-sponsor
Copy link

stevennevins marked the issue as disagree with severity

@stevennevins
Copy link

While annoying, i think this is a Medium severity issue. The attacker has to under price their proposal, defend this under priced proposal from other users and front run each purchase > 1, while selling their Raes at a loss, and it would be relatively costly for griefer to defend their underpriced proposal for the duration of the proposal period. Users could purchase 1 Rae at a time without risk of front running

C4-Staff added a commit that referenced this issue Jan 6, 2023
@HickupHH3
Copy link

Agree with med severity given the external requirements needed to pull this off.

@c4-judge
Copy link
Contributor

HickupHH3 changed the severity to 2 (Med Risk)

@c4-judge c4-judge added 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 primary issue Highest quality submission among a set of duplicates and removed 3 (High Risk) Assets can be stolen/lost/compromised directly labels Jan 11, 2023
@c4-judge
Copy link
Contributor

HickupHH3 marked the issue as primary issue

@c4-judge
Copy link
Contributor

HickupHH3 marked the issue as selected for report

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 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 M-02 primary issue Highest quality submission among a set of duplicates selected for report This submission will be included/highlighted in the audit report
Projects
None yet
Development

No branches or pull requests

6 participants