Tea

Tea.xyz: Tea Token

Cantina Security Report

Organization

@Tea-1452

Engagement Type

Cantina Reviews

Period

-


Findings

Low Risk

2 findings

2 fixed

0 acknowledged

Informational

1 findings

1 fixed

0 acknowledged


Low Risk2 findings

  1. Incorrect recovered address when signer's fallback function is triggered

    State

    Fixed

    PR #4

    Severity

    Severity: Low

    Submitted by

    Om Parikh


    Description

    If signer has fallback when isValidSignature function is not present, then it will return arbitrary data and not the magic value.

    This case returns false correctly. however, the recovered variable would not be correct as it will be the address recovered from ECDSA logic.

    Recommendation

    Consider explicitly setting recovered address to address(0)

    try IERC1271(signer).isValidSignature(digest, signature) returns (bytes4 magicValue) {                 if (magicValue == IERC1271.isValidSignature.selector) {                     return (true, address(0));+                } else {+                    return (false, address(0)); // or recovered = address(0)                 }             } catch {                 return (false, recovered);
  2. increase & decrease allowance can be removed

    State

    Fixed

    PR #4

    Severity

    Severity: Low

    Submitted by

    high byte


    Summary

    increase & decrease allowance functionalities were removed from openzeppelin for security reasons. hence I recommend to remove them here as well.

    Recommendation

    unless strictly required, it is advised to conform to modern security standards and also simplify the contract by removing this funcitonality.

Informational1 finding

  1. Unused structs, variables & imports

    State

    Fixed

    PR #4

    Severity

    Severity: Informational

    Submitted by

    Om Parikh