You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
Basically when an action is executed, we can add notifier by calling require_recipient. It's useful for linking actions from different contracts to work as a whole. But it also introduces new security problems. If the recipient itself is a contract, then the recipient's action handler can consume RAM on behalf of the original action. This may not be the expected result of original action. Following snippet shows that require_authorization only checks the authorization against the current action.
How to solve this problem?
Contracts delegating action processing to other contracts have a trust relationship with the other contracts. To prevent unexpected RAM consumption, the best way is to control all of the relevant accounts and contracts. A less attractive but possibly effective way is to only delegate to verified open source contracts that have been frozen by dropping ownership permissions.
There have been discussions about how to provide relative certainty that you can delegate to an arbitrary contract and still be assured there will be no RAM consumption. Code has not yet been written and there is no schedule. Watch future release notes.
I believe inline actions should have a way to verify or limit how much resources has been consumed during the executed action. This can be done either by explicitly limiting the resources of inline action before execution or be able to access transaction context where you would be able to calculate the difference in resource consumption before and after the inline action took place. I think this should be also applied to the deferred transaction.
The third option that I see is to introduce a special permission that has to be given to each and every cc action (actions executed via require_recipient) in advance for the cc action to do anything relevant in the name of action's actor.
The last solution adds a bit more overhead to the developer's workflow so I believe first two options should be considered.
Basically when an action is executed, we can add notifier by calling require_recipient. It's useful for linking actions from different contracts to work as a whole. But it also introduces new security problems. If the recipient itself is a contract, then the recipient's action handler can consume RAM on behalf of the original action. This may not be the expected result of original action. Following snippet shows that require_authorization only checks the authorization against the current action.
How to solve this problem?
The text was updated successfully, but these errors were encountered: