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

OlaHamid - Denial of Service in cancelStreams Due to Single Failing nounId #188

Open
sherlock-admin4 opened this issue Nov 30, 2024 · 0 comments

Comments

@sherlock-admin4
Copy link

sherlock-admin4 commented Nov 30, 2024

OlaHamid

Medium

Denial of Service in cancelStreams Due to Single Failing nounId

Permalink


SUMMARY

The fastForwardMultipleStreams function processes arrays of nounIds and ticksToForward to fast-forward multiple streams. However, the function lacks ownership validation for the nounIds before calling fastForwardStream(nounIds[i], ticksToForward[i]). This allows for unintended or unauthorized manipulation of streams by callers who do not own the nounIds in question.


ROOT CAUSE

The absence of a check to ensure the caller owns each nounId being processed leads to potential misuse of the fastForwardMultipleStreams function.


PRECONDITIONS

Internal Precondition

  1. The fastForwardStream function does not verify ownership of the nounId.

External Precondition

  1. A caller supplies an array of nounIds they do not own.

ATTACK PATH

  1. A malicious user calls fastForwardMultipleStreams with an array of nounIds, including IDs they do not own.
  2. The function processes these IDs without validating ownership, potentially impacting streams belonging to other users.

IMPACT

  • Unauthorized manipulation of streams owned by other users.
  • Potential disruption or misuse of streams, impacting system integrity.

PROOF OF CONCEPT (PoC)


MITIGATION

Add ownership validation for each nounId in the fastForwardMultipleStreams loop:

function fastForwardMultipleStreams(uint256[] calldata nounIds, uint32[] calldata ticksToForward) external {
    require(nounIds.length == ticksToForward.length, "length mismatch");
    for (uint256 i; i < nounIds.length; ++i) {
        require(msg.sender == nounsToken.ownerOf(nounIds[i]), "Caller does not own nounId");
        fastForwardStream(nounIds[i], ticksToForward[i]);
    }
}

@sherlock-admin4 sherlock-admin4 changed the title Generous Peanut Platypus - Denial of Service in cancelStreams Due to Single Failing nounId OlaHamid - Denial of Service in cancelStreams Due to Single Failing nounId Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant