From 917086bb523ff87f2c982c200aaf5dc1f71e4d7e Mon Sep 17 00:00:00 2001 From: Brendan Graetz Date: Tue, 22 Aug 2023 17:34:49 +0800 Subject: [PATCH] docs: HIP-792 add security implications and how to teach this sections Signed-off-by: Brendan Graetz --- HIP/hip-792.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/HIP/hip-792.md b/HIP/hip-792.md index b7bd1d123..02cadabdb 100644 --- a/HIP/hip-792.md +++ b/HIP/hip-792.md @@ -99,10 +99,34 @@ Notably, this HIP proposes changes to neither `isAuthorized(address, messageHash +Ensure that this proposal considers +the [new model (v2) boundaries](https://docs.hedera.com/hedera/core-concepts/smart-contracts/security#new-model-v2-boundaries) +and does not break its stipulations. +Specifically: + +- Consider that top-level signatures are not supported +- Consider that `delegatecall` on the system contract is not supported + +Consider that smart contract developers may do the following: + +- Multiple smart contracts utilize the `isAuthorizedCurrentTransaction` call to do multiple things +- Authorize all potential uses of a user's signature in the parent transaction + +These could imply the user has given their authorization for all such combinations. Therefore sufficient warnings should be embedded in any [educational materials](#how-to-teach-this) related to this. + ## How to teach this +Provide a [short, self contained, correct code example](http://sscce.org/) +which demonstrates this HIP, with both error-path and happy-path examples. +This will be in the style of existing work: + +- [Multisig Account](https://github.com/hedera-dev/hedera-code-snippets/tree/main/multisig-account) + +Provide sufficient warnings about improper use of `isAuthorizesCurrentTransaction` in a tutorial, +at minimum including a list of "Do's and Don'ts". + ## Reference Implementations @@ -111,6 +135,11 @@ Notably, this HIP proposes changes to neither `isAuthorized(address, messageHash +- Allow `delegatecall` on the `hederaAccountService` system contract + - Rejected becuase: Contradiction of v2 smart contract security model + - If there is indeed a community request that asks from specific exemption, we can ask them to submit a HIP that would specifically whitelist those specific flows, and then consider those. + - This path has already been trodden with HTS - "System smart contracts may not be delegate called, except from the Token proxy/facade flow, e.g., HIP 719. In such cases, HTS tokens are represented as smart contracts (see HIP 218) for common ERC methods." + ## Open Issues @@ -122,7 +151,8 @@ Nil - [HIP-632 - Hedera Account Service (HAS) System Contract](../hip-632) -- [`ecrecover` Precompiled Contract](https://ethereum.github.io/execution-specs/autoapi/ethereum/frontier/vm/precompiled_contracts/ecrecover/index.html) +- [Hedera - Smart Contract Security - Security Model - New model (v2) boundaries](https://docs.hedera.com/hedera/core-concepts/smart-contracts/security#new-model-v2-boundaries) +- [Ethereum - `ecrecover` Precompiled Contract](https://ethereum.github.io/execution-specs/autoapi/ethereum/frontier/vm/precompiled_contracts/ecrecover/index.html) ## Copyright/license