crytic / tealer

Static Analyzer for Teal
GNU Affero General Public License v3.0
61 stars 14 forks source link

Use txn type information for CanCloseAccount and CanCloseAsset detectors #128

Closed S3v3ru5 closed 1 year ago

S3v3ru5 commented 1 year ago

CanCloseAccount detector finds execution paths that allow the txn CloseRemainderTo field to have any address. CloseRemainderTo field can only be set for Payment type transactions. If the contract asserts that txn is not a Payment type txn, it is not vulnerable to CanCloseAccount.

And The CanCloseAsset detector which checks if the AssetCloseTo field can have any address. The AssetCloseTo field can only be set for AssetTransfer type transactions.

This PR supports using the transaction type information while enumerating the vulnerable execution paths.

montyly commented 1 year ago

Build on top of https://github.com/crytic/tealer/pull/127