#37153 [BC-Insight] Malicious validator can bring down honest nodes

Submitted on Nov 26th 2024 at 21:40:06 UTC by @br0nz3p1ck4x3 for Attackathon | Ethereum Protocol

  • Report ID: #37153

  • Report Type: Blockchain/DLT

  • Report severity: Insight

  • Target: https://github.com/prysmaticlabs/prysm

  • Impacts:

    • Shutdown of less than 10% of network processing nodes without brute force actions, but does not shut down the network

Description

Hey friends,

We stumbled upon the following during our research & hope this will add value to the Prysm team.

Description

If we take a look at validateBlsToExecutionChange(), we can see the following:

func (s *Service) validateBlsToExecutionChange(ctx context.Context, pid peer.ID, msg *pubsub.Message) (pubsub.ValidationResult, error) {
//..
	// Validate that the execution change object is valid.
	_, err = blocks.ValidateBLSToExecutionChange(st, blsChange)
//..
}

ValidateBLSToExecutionChange() is called.

Now, let's take a look at ValidateBLSToExecutionChange():

There is an out of bounds read here that can be triggered by a malicious validator:

If the malicious validator populates the WithdrawalCredentials with a nil value, an out of bounds read happens which will lead to a panic.

In psuedo-code, the malicious validator should:

  • Send a ethpb.SignedBLSToExecutionChange message to the honest validator

  • Make sure the WithdrawalCredentials is of anil value

  • Out of bounds will be triggered

Please check the Proof of Concept below.

Severity Rationale

This attack is limited to the p2p nodes that a node is connected too thus, according to the Immunefi Severity Classification we decided to submit this as a Medium Severity issue.

Apply the following patch to ValidateBLSToExeuctionChange():

Proof of Concept

Proof of Concept

Apply the following patch tovalidate_bls_to_execution_change_test.go:

Now, do the following:

  • cd beacon-chain/sync

  • go test -timeout 30s -run ^TestService_ValidateBlsToExecutionChange

The output will be the following:

Out of bounds error leading to panic.

Was this helpful?