Skip to content
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

Removing permissioned access mode makes rate limiting harder #672

Closed
ameba23 opened this issue Mar 15, 2024 · 1 comment
Closed

Removing permissioned access mode makes rate limiting harder #672

ameba23 opened this issue Mar 15, 2024 · 1 comment

Comments

@ameba23
Copy link
Contributor

ameba23 commented Mar 15, 2024

This is maybe a nitpicky edge-casey problem but i think its worth being aware of.

Removing permissioned access mode means we use no longer control rate limiting on a per-user basis. We use the public verifying key rather than the signature request key in order to track how many requests have come from a single account.

This should not be a problem, since the rate limit counter only gets incremented after the signing protocol has run, which means a request which does not result in a successful program evaluation never counts towards the rate limit. So we can still have per-user rate limiting by implementing permissioning within a program.

However, with program-based permissioning it is impossible to protect against replay attacks. That is, given a message and a signature made with the public key from a permissioned program's configuration, one can repeatedly run the program successfully, and therefore repeatedly run the signing protocol and increment the rate limit counter.

This was previously impossible with permissioned access mode because of the timestamp checks. We cannot implement nonce or timestamp checks in programs because they do not hold state or have access to the system clock.

So what i'm saying is - with permissioned programs, any signed message made with the keypair used for in-program authentication must be kept secret, as it could be used to maliciously block the account by repeatedly signing the same message and activating the rate limit.

@HCastano
Copy link
Collaborator

HCastano commented Sep 9, 2024

Closing, should maybe be considered when implementing the message passing in #1033.

@HCastano HCastano closed this as completed Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants