Weather Witness

First Flight #40
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: high
Valid

[EVMNINJA-WW04] Missing Request Data Cleanup

Root + Impact

Description

After fulfilling a request, the contract does not clear the data in s_funcReqIdToUserMintReq and s_funcReqIdToMintFunctionReqResponse mappings. This wastes storage and could potentially allow reuse of request IDs if there are collisions.

function fulfillMintRequest(bytes32 requestId) external {
// ... processing logic
// No cleanup of mappings after use
}

Risk

Likelihood:

High likelihood.

Impact:

Low impact.

Proof of Concept

Recommended Mitigation

Clean up the mappings after processing the request:

function fulfillMintRequest(bytes32 requestId) external {
// ... existing processing logic
// After successful processing, clean up the mappings
delete s_funcReqIdToUserMintReq[requestId];
delete s_funcReqIdToMintFunctionReqResponse[requestId];
}
Updates

Appeal created

bube Lead Judge 5 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Multiple tokens for one `requestId`

The `WeatherNFT::fulfillMintRequest` allows a malicious user to call multiple times the function with the same `requestId`.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.