-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offset faucet procedures by 1
to enable correct authentication
and reserved slot
access
#864
Comments
1
to enable correct authentication
and reserved slot
access
@bobbinth, thinking more about it I am not entirely sure I understood how this would solve our issue regarding faucets. If I offset all procedures by 1 I won't be able to access location 0 of the storage anymore. Furthermore we do not have the ability to add real offsets to procedures for now hence all faucets would just get their storage offset by 1. I am not sure how shifting the faucet storage by 1 would solve our issue here. |
I think that's what we actually want: we want to make sure that user procedures cannot access slot 0 because this slot is reserved for internal faucet usage (we should still be able to access this slot from within the kernel because offsets are applied in the
There are two things we need to do:
For point 2, we probably need to create a separate procedure which will also solve #863. |
Hello @bobbinth, I have started working on this issue and I have a few questions:
We could now only access the faucet reserved storage slot from inside the kernel. But for example in tests we are asserting the correct update of this storage slot: here:
here:
Hence these tests are now failing and I do not see a simple solution to be able to refactor them other than doing in kernel procedure invocations again.
This would enable me to bypass the Let me know your thoughts, thank you. |
The current solution incorrectly allows user procedures to access storage slots which are reserved by the faucet. The temporary solution is only for the Rust side. On the MASM side, once this issue is addressed, we won't have this vulnerability.
Yeah, we don't want to go back to doing that. You can probably re-work the tests to read the reserved slot directly from process memory (i.e., don't try to access it via MASM but directly via the |
Related to this issue, it seems that the public key slot on I think this is causing some issues when running integration tests from the client against |
It should be fixed by this PR: #875 |
Feature description
Since this PR: #846 we have changed the reserved storage slot location of faucet accounts to 0. Hence breaking the standard that we had up to now for authentication storage slot. Where the
pub_key
of the account would be stored at location 0.Goal of this issue:
Add a boolean flag to
AccountCode
checking if the account is a faucet or not and if it is offset all account procedures by 1 (added to the actual offset of the account procedures).This will enable to keep the authentication at storage location 0 (offset) and reserved slot at storage location 0 (virtually).
Why is this feature needed?
Faucets now use storage slot 0 as their reserved slot.
We need to offset to the correct location in storage for authentication.
The text was updated successfully, but these errors were encountered: