Skip to content
Access control Audit finding Intermediate

Signature Checks could be passed when SignatureDecoder.recoverKey() returns 0

The signature validity check in a smart contract could be bypassed when the signature recovery function returned zero, allowing any user to call changeOrder or setComplete after an approved hash existed. An attacker could then modify orders or mark tasks complete without proper authorisation.

cryptphi Follow

Originally disclosed on Code4rena

Submitted by cryptphi, also found by 0x1f8b and defsec

Project.sol#L887 Project.sol#L108-L115

It is possible to pass Signature Validity check with an SignatureDecoder.recoverKey() returns 0 whenever the builder and /or contractor have an existing approved hash for a data.

With occurrence of above, any user can call changeOrder or setComplete functions successfully after user approves data hashes.

Recommended Mitigation Steps

There should be a require check for _recoveredSignature != 0 in checkSignatureValidity().

parv3213 (Rigor) confirmed


The original report as published on Code4rena, by cryptphi. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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 signature validity check did not reject a recovered address of zero, so an invalid signature that recovered to zero passed the check.

Impact

Any user could call changeOrder or setComplete successfully after an approved data hash existed, potentially altering orders or marking work complete without authorisation.

What the attacker needed

An existing approved hash for data; ability to call contract functions

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 checks that a message was signed by the right person. The check used a function that returns zero when it cannot recover a signer, and zero was treated as a valid signer. This let anyone act as if they had permission once an approved hash existed.

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.

More by cryptphi

View all

7 more disclosed reports, best first.

More from Rigor Protocol contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.