updateProjectHash does not check project address
The updateProjectHash function does not verify that the signed data includes the project's address, unlike other functions. This allows reusing a signature from one project on another project with the same builder/contractor and nonce, enabling an attacker to change a task hash.
Submitted by MEP, also found by byndooa, Haipls, and minhquanym
In Project.sol, function updateProjectHash L162, _data (which is signed by builder and/or contractor) does not contain a reference to the project address. In all other external functions of Project.sol, _data contains the address of the project, used in this check:
require(_projectAddress == address(this), "Project::!projectAddress");.
The lack of this verification makes it possible to reuse the same _data, and the same _signature on another project, in the case the latter has the same builder and/or contractor, and the same _nonce. In pratice, if the same group of people starts a new project, when _nonce reaches the correct value, anyone can change the hash of a task (if we suppose that that updateTaskHash() was used in the previous project).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the updateProjectHash function omits the project address from the signed data, unlike other functions that include a check.
Impact
If the same group starts a new project and the nonce matches, anyone could change a task hash, assuming updateTaskHash was used in the previous project.
What the attacker needed
Same builder and/or contractor; same nonce value; updateTaskHash used in previous project
The fix
The function should include the project address in the signed data and verify it, as other functions do.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract uses digital signatures to authorise changes. Each signature should be tied to a specific project so it can't be reused elsewhere. Here, one function forgot to include the project's address in the signed data, so a signature from one project could be replayed on another project with the same participants and nonce, letting someone alter a task hash.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.