aligned_layer icon indicating copy to clipboard operation
aligned_layer copied to clipboard

fix(aggregator): attack on aggregator race condition censoring a batch

Open entropidelic opened this issue 1 year ago • 1 comments

Problem

When a BLS signature is responded to the aggregator, there is a batchResponses[operator_id] that is updated. This was done to prevent errors that appear due to some operators responding more than one time.

The problem is that there is no validation of the signature before updating the map, so an invalid SignedTaskResponse will still cause the map to be updated. If an attacker sends many invalid STRs, they could cause the batchResponse map to be set most of the time, so when a valid STR is received, it will likely be ignored as if it had already been received.

Solution A (WIP, doesn't work)

This solution must be done on ProcessOperatorSignedTaskResponseV2

An address of the operator can be found on the SignedTaskResponse

Use the address received in the task we need to call GetOperatorInfo from OperatorsInfoServiceInMemory.

With this we can get the OperatorID and a operatorInfo.

operatorInfo contains Pubkeys, with a PublicKey on G1, and G2. These are two different public keys, one is used in some cases, the other one in others.

Having this information, the following must be enforced

  • Obtained operatorInfo OperatorID matches the OperatorID on the SignedTaskResponse
  • SignedTaskResponse has been correctly signed by the operator. signedTaskResponse.BlsSignature.Verify(G2,signedsignedTaskResponse.BatchMerkleRoot)

The purpose is to avoid impersonations, it's not necessary to check if the Operator is actually registered and the stakes, so it's simpler than the verification of the BlsService

entropidelic avatar Sep 16 '24 17:09 entropidelic

This issue is on a standby, Eigen has the PR fixing the bug of the double signature, so we can fix it by removing our code to solve this

MauroToscano avatar Sep 24 '24 18:09 MauroToscano

Eigen fixed the bug, and we removed all the code related to avoiding the double signatures, this is solved

MauroToscano avatar Nov 23 '24 21:11 MauroToscano