Factory uses signature that do not have expiration
The Factory contract verifies signatures without any expiration time, so a signature remains valid indefinitely. An attacker who obtains a valid signature can reuse it forever, and the only way to revoke it is to change the trusted signer role.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2022-10-nftport-judging/issues/46
Found by
rvierdiiev
Summary
NftPort can't remove license from user, once the signature was provided to it, without changing SIGNER_ROLE address.
Vulnerability Detail
In Factory contract there are few methods that are called when signed by trusted signer.
This is how the signature is checked
signedOnly(abi.encodePacked(msg.sender, instance, data), signature)
As you can see there is no any expiration time. That means that once, the signer has signed the signature for the user it can use it for the end of life. It's like lifetime license.
The only option to remove the license from user is to revoke SIGNER_ROLE and set it to another account.
But it's possible that the NFTPort will have a need to do that with current signer.
Impact
License can't be removed.
Code Snippet
Tool used
Manual Review
Recommendation
Add expiration param to the signature.
Discussion
hyperspacebunny
Fixed in https://github.com/nftport/evm-minting-sherlock-fixes/pull/18
rayn731
Fixed, it checks expiration on metadata.expiration, and it follows EIP-712 standard for hashing and signing data.
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
The signature verification does not include an expiration timestamp, so signed messages remain valid indefinitely.
Impact
A valid signature can be reused indefinitely, and the only way to revoke it is to change the trusted signer role, which may not always be possible.
What the attacker needed
A valid signature from the trusted signer
The fix
The issue was fixed by adding an expiration parameter to the signature and checking it, following the EIP-712 standard.
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 signature is like a stamped permission slip that proves the signer approved something. Here, the permission slip never expires, so if someone gets one, they can use it forever. The only way to cancel it is to change who is allowed to sign, which affects everyone.
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.