`createCommonProjectIDAndDeploymentRequest()` hardcodes request id index to 0, leading to lost requests for users
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-03-crestal-network-judging/issues/205
Found by
0x73696d616f
Summary
createCommonProjectIDAndDeploymentRequest() is called by createAgent(), in which the user pays fees to create an agent. The index is supposed to protect the user from overwritting a requestId with the same requestId but different serverURL. However, it is hardcoded to 0.
Root Cause
In BlueprintCore:373, index is 0.
Internal Pre-conditions
None.
External Pre-conditions
None.
Attack Path
- User creates an agent for a certain projectId, base64Proposal, server url.
- User creates an agent (at the same block) with the same projectId, base64Proposal but different server url.
- First request is overwritten.
Impact
First request is overwritten and one of them will not be finalized as submitProofOfDeployment() and submitDeploymentRequest() can only be called once as part of the final steps by the worker. However, the user paid fees for both requests, but only one of them will go through.
PoC
See above.
Mitigation
Index should be increment in a user mapping.
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/crestalnetwork/crestal-omni-contracts/pull/28
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity business logic bug in Crestal Network. Sherlock made it public on 26 March 2025. Found in the 755 audit contest (finding M-1).
About Business logic
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.