Replies: 1 comment 3 replies
-
Notes with invalid codeIt is possible to hit some code paths that panic in the assembler, here is a simple example:
Sending such a note causes a panic. Depending on how the system is integrated this can result into a crash. (I have not looked up on the binary representation codepath, so I'm not sure if that is an issue there). |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Motivated by #7 (reply in thread) I'd like to list out potential DOS attack vectors so that we could start thinking about potential mitigating strategies. This will be an initial list, and we'll probably add to it as time goes on.
Locally proven transactions
I think attack surface for locally proven transactions is relatively small. A malicious user could do a few things though:
*. Submit an invalid transaction with a valid proof. For example, a transaction which consumed an already consumed note, or is executed against an old account state. Unlike the previous case, this type of an issue cannot be validated in isolation and will require some lookups in the DB (or some in-memory structure).
I think there are two broad strategies of mitigating the above attacks:
Network transactions
These are the transactions which are executed by the operator. These break down further based on the type of notes consumed. Specifically, transactions which consume notes with type
11
are intended to be executed by the operator without any additional user inputs. Transactions which consume notes with type00
or10
are intended to be executed by users locally, but users can ask the operator to execute such transactions (i.e., if a user is on a low-power device and cannot generate a local proof). Attack vectors for these transaction categories are different.Transactions consuming notes with type
11
The attack vectors I see here are:
110
). I actually don't think that this is an attack vector as operators can probably just ignore such notes.I actually don't think that the last attack is concerning. The reason is that the attacker would need to pay for this attack quite a bit. Specifically:
Thus, forcing the operator to execute code for malicious transaction requires paying fees for two transactions - which probably makes this attack impractical at a large scale.
Transactions consuming notes with type
00
or10
As mentioned above, these notes are indented for local execution, but users may ask operators to execute transactions consuming such notes for a variety of reasons.
The main attack vector here is similar to point 3 from the previous section: users may craft transactions in a way which fails at the very last step. However, in this case, crafting such transactions is nearly free to the user. What's worse, is that we can't force the user to do any kind of significant work as one of the main use cases for asking operator to execute such transaction is for users on low-power devices.
This is a general problem for account abstractions (e.g., see here) - but I think in our case it may be a bit simpler because execution is only a small part of the proving process (i.e., like less than 100th). This should enable strategies which are not available in other settings.
Two broad strategies for addressing these attacks are:
Beta Was this translation helpful? Give feedback.
All reactions