Part of CertiK’s retainer series
CertiK reviewed WEMIX (Wemix Retainer 26 (NFT Refund)) on 5 Sep 2023: 7 findings, 0 critical; none marked fixed.
Report hosted on skynet.certik.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 1 | 0 | 0 |
| Medium | 0 | 0 | 0 |
| Low | 6 | 0 | 0 |
In the contract `NFTBurnByValidator` the roles `owner` and `validator` have authority over the functions shown in the diagram below. Any compromise to the `owner` or `validator` account may allow the hacker to take advantage of this authority and sign user signatures to burn NFT and refund tokens.  In the contract `NFTTreasury` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and `changeTreasury()` and `changeRefundAmount()`.  In the contract `NFTLockable` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority to update the status of the `paused` and further pause/resume the token transfer status functionality of the `setTransferable()` function, and set the address of the fee token.  In the contract `NFTLockable` the roles `owner` and `validator` have authority over the functions shown in the diagram below. Any compromise to the `owner` or `validator` account may allow the hacker to take advantage of this authority and sign user signatures to mint NFT, and change the transfer status of tokens owned by the user. 
The `refundByValidator()` function unlocks the NFT before refunding tokens. Once the NFT has been unlocked, it cannot be burned to refund tokens.
Encoding through `abi.encodePacked()` is used with dynamically-sized inputs controlled by the user. This type of encoding is susceptible to malleability when used with strings, bytes, or other dynamically-sized types. As such, it is not a good choice for signature verification with the input used, since users can change the input and potentially get the same bytes output from `abi.encodePacked`. ```solidity=93 onlyValidatorSig(abi.encodePacked(tokenURI, userSig), validatorSig) ``` - `abi.encodePacked` is called with dynamically-sized arguments: `tokenURI`, `userSig` ```solidity=88 string calldata tokenURI, ``` - `tokenURI` is a dynamically-sized external parameter. ```solidity=89 bytes calldata userSig, ``` - `userSig` is a dynamically-sized external parameter.
Signed messages are not properly verified with the current chain ID, thus allowing attackers to perform replay attacks across chains. Hardcoded or cached chain ID values are also vulnerable since a hard fork may occur and change the chain ID in the future.
Both `burnByValidator()` and `refundByValidator()` functions emit the same `NFTBurned` event, while the `refundByValidator()` function refunds tokens after the NFT has been burned.
The `changeTreasury()` function allows the owner to change the `treasury` address. If the new `treasury` address is that of the `NFTTreasury` contract, all tokens in the old `treasury` address will be migrated to the `newTreasury` address. However, if the old `treasury` address is an EOA address, no tokens will be transferred, and the `treasury` will need to migrate the tokens separately.
If the data signed by users is approved and signed by a validator, the signed data `userSig` and `validatorSig` can be used as input to call `burnByValidator()` or `refundByValidator()`. The `burnByValidator()` function will unlock and burn the NFT, while the `refundByValidator()` function will additionally refund the `account` wallet. The caller can choose whether to refund tokens or not by choosing which function to call. ```solidity=42 require(account == ECDSA.recover(keccak256(abi.encodePacked(address(this), tokenID, account, column)), userSig), "NFT: user recover error"); ```
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (3)
1,045 projects reviewed · 1,376 reports · latest May 2025
See CertiK’s auditsSomething wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.
Tell us