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

Signature Request Payload Collision #548

Closed
Tracked by #473 ...
think-in-universe opened this issue Mar 30, 2024 · 3 comments
Closed
Tracked by #473 ...

Signature Request Payload Collision #548

think-in-universe opened this issue Mar 30, 2024 · 3 comments
Assignees
Labels
API Emerging Tech Emerging Tech flying formation at Pagoda Near BOS NEAR BOS team at Pagoda

Comments

@think-in-universe
Copy link
Member

think-in-universe commented Mar 30, 2024

Description

The MPC contract now uses payload as the key for chain signature request and response: https://github.com/near/mpc-recovery/blob/e1cbbd0d03500844008bdf48d981356263c3b7ec/contract/src/lib.rs#L370-L372

But it's possible that payloads from different users can be the same and leads to key collision (if nonces are the same). The latter request cannot be sent until the former one with the same payload is fulfilled.

This can be reproduced by sending the same amount of ETH to the same addresses from two new derived accounts, with the demo component by Matt: https://test.near.social/md1.testnet/widget/chainsig-sign-eth-tx

@think-in-universe think-in-universe added Near BOS NEAR BOS team at Pagoda Emerging Tech Emerging Tech flying formation at Pagoda labels Mar 30, 2024
@volovyks volovyks added the API label Apr 1, 2024
@ppca
Copy link
Contributor

ppca commented Jul 16, 2024

This won't be a problem any further because we now use

pub struct SignatureRequest {
    pub epsilon: SerializableScalar,
    pub payload_hash: [u8; 32],
}

as the key chain signature request and response, where epsilon is calculated based on path and predecessor of the request. So even if the two requests have the same payload, they won't have a clash unless predecessor and path are also the same.

@ppca ppca closed this as completed Jul 16, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Emerging Technologies Jul 16, 2024
@volovyks
Copy link
Collaborator

@ppca are we handling the case where the same user calls the contract with the same payload? Are we rejecting such a call in new Y/R design?

@ppca
Copy link
Contributor

ppca commented Jul 17, 2024

Yes it will be rejected still until it's completed or timed out.

@ppca ppca self-assigned this Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Emerging Tech Emerging Tech flying formation at Pagoda Near BOS NEAR BOS team at Pagoda
Projects
Status: Done
Development

No branches or pull requests

3 participants