Skip to content
DoS Audit finding Intermediate

The malicious node may not execute the http request

A node in the blockchain network can choose not to execute an HTTP request that is supposed to call an external API, preventing the API from being invoked. This can cause the protocol to fail or reduce efficiency.

LZ_security Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-06-allora-judging/issues/107

Found by

LZ_security

Summary

Vulnerability Detail

topics_handler will make an http request to call the http api in blockless,

Go
func makeApiCall(payload string) error {
	url := os.Getenv("BLOCKLESS_API_URL")
	method := "POST"

	client := &http.Client{}
	req, err := http.NewRequest(method, url, strings.NewReader(payload))
	if err != nil {
		return err
	}
	req.Header.Add("Accept", "application/json, text/plain, */*")
	req.Header.Add("Content-Type", "application/json;charset=UTF-8")

	res, err := client.Do(req)
	if err != nil {
		return err
	}
	defer res.Body.Close()

	return nil
}

It is often dangerous to initiate an http request in a node on a blockchain chain. However, because the operation here is performed in a PrepareProposalHandler, it may not result in direct state inconsistency between different nodes.

But the problem here is that the malicious node can not perform this operation, so blockless can not receive http requests.

Because other nodes have no way of knowing whether the http request can be successfully executed, the http request may fail due to network problems.

Therefore, the malicious node can choose not to execute the http request, so that he can save server-side resources, or in the purpose of attack.

Impact

The api in blockless cannot be invoked because the malicious node does not execute the http request,causing the protocol to fail to work or affecting blockless working efficiency.

Code Snippet

https://github.com/sherlock-audit/2024-06-allora/blob/main/allora-chain/app/api.go#L166-L185

Tool used

Manual Review

Recommendation

Let blockless query data from the chain instead of the node on the chain calling blockless.

Discussion

sherlock-admin3

1 comment(s) were left on this issue during the judging contest.

0xmystery commented:

Malicious node could cause http request to not execute

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/allora-network/allora-chain/pull/458

The original report as published on Sherlock, by LZ_security. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, the system relies on each node to voluntarily make an HTTP request during block preparation, without any mechanism to verify that the request was actually made.

Impact

The external API may not be invoked, causing the protocol to fail to work or affecting its efficiency.

What the attacker needed

Malicious node in the network

The fix

The external service should query data from the blockchain instead of relying on a node to call it.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

In a blockchain, many computers (nodes) work together. This report says one of those computers can skip sending a request to an outside service, and because no one checks, that service might never get called. This could break part of the system.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by LZ_security

View all

8 more disclosed reports, best first.

More from Allora

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.