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

Handling a Malicious Operator Adding / Overweighting Malicious Staking Pools #13

Closed
fyquah opened this issue Sep 12, 2021 · 2 comments
Closed

Comments

@fyquah
Copy link

fyquah commented Sep 12, 2021

How does meta-pool prevent a malicious operator / owner from setaling coins via a malicious staking pool? A attack vector i'm thinking of:

  1. A malicious actor gets voted in as an operator
  2. The owner creates malicious contract that implements the staking pool NEP. The malicious bit is deposit simply increases their balance in the staking pool, regardless of the sender. And withdraw only ever withdraws to the attacker's address
  3. The owner adds the staking pool to the list of staking pools in metapool, and overweights it in the following line:

pub fn set_staking_pool_weight(&mut self, inx: u16, weight_basis_points: u16) {

  1. When people run ping or stake, then coins are "stolen" into the malicious staking pool that implements the NEP, but is otherwise malicious

I feel like I'm missing something - or is such attacks simply possible?

@luciotato
Copy link
Contributor

Solution: add a check that all the staking-pools account_ids are in the form *.poolv1.near, and that will solve the issue, because all staking-pools created as *.poolv1.near can only be deployed by the whitelisted stake-pool factory

@luciotato
Copy link
Contributor

Thanks @fyquah for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants