Cointelegraph
DOGE$0.07364 1.18%
TRX$0.3277 0.53%
LINK$8.70 2.54%
ZEC$543.38 0.94%
ADA$0.1744 5.72%
XRP$1.13 2.65%
ETH$1,932.49 2.12%
BTC$66,294.68 2.14%
XMR$344.25 2.46%
BNB$577.14 1.10%
XLM$0.1920 1.80%
SOL$78.34 1.64%
HYPE$62.82 2.50%
Written by Allen Scottstaff editorReviewed by Allen Scottstaff editor

Near patches critical bug that could crash every node on the network

MagazinePublishedOct 8, 2024

Researchers found a vulnerability in NEAR’s peer-to-peer networking protocol that could have crashed any node, but it was patched before an attacker could discover it.

near-patche-web3-ping-vulnerability

The smart contract platform Near Protocol contained a weird vulnerability that could have allowed an attacker to crash every node on the network, effectively shutting it down.

According to a Sept. 26 report from blockchain security firm Zellic, which discovered it, the vulnerability was quietly eliminated through a patch in January, but some networks may still contain similar flaws.

In the report, Zellic referred to the flaw as a “Web3 Ping of Death” due to its ability to bring down an entire network “in an instant.”

Researchers discovered it while investigating Near’s peer-to-peer networking protocol for validator nodes, which allows its validators to communicate effectively with each other.

Nodes on the network communicate and authenticate each other via a “handshake” containing one of two types of signatures, Ed25519 and SECP256K1.

While verifying the signature for Ed25519 worked fine, verifying SECP256K1 signatures resulted in a “panic” response that crashed the node.

A diagram of a peer-to-peer connection established between two peers. Source: Zellic

Having discovered this flaw, the researchers were surprised that it had not either been caught previously in tests or else crashed the network already.

The reason was more good luck than good management. It turns out that Near node software has “no code path that allows a Near node to generate SECP256K1 type keys.” In other words, the software allowed nodes to accept SECP256K signatures but didn’t allow them to produce such signatures.

As a result, no node had ever accidentally crashed the network by creating SECP256K keys and attempting to connect to another node.

Even so, a malicious node could alter the software to allow SECP256K keys to be generated. Once they did, they would have the power to crash any Near node simply by attempting to connect to it. The result could take down the entire network, constituting a “Web3 Ping of Death.”

To prove that the vulnerability was real, the researchers first created a version of the Near software containing a malicious patch that allowed SECP256K keys to be generated.

Error-throwing function vulnerability in Near. Source: Zellic

They then launched two nodes on a private testnet version of Near. The first node ran the legitimate software provided by developers, while the second ran the malicious version.

After the first node began producing blocks, the second node attempted to crash the first one by exploiting the two vulnerabilities. They found that the malicious node succeeded at crashing the legitimate one every time.

Related: Solana outage triggers ballistic reaction from the crypto community

Zellic secretly disclosed the vulnerability to the Near team in December, using HackenProof’s bug bounty platform to facilitate the disclosure. In response, the team paid Zellic a $150,000 reward and patched the node software in January.

The discovery of the vulnerability provided a happy ending to what otherwise could have been a story of crisis.

Other blockchains have not been lucky enough to avoid flaws that resulted in crashes. In December, the Arbitrum network went down for over 78 minutes, preventing users from making any transactions.

Developers later revealed that this downtime was caused by a surge of inscription minting, which the network was inadequately prepared to handle.

According to developers, in January, around 50% of Cardano nodes went down due to an “anomaly.” The disruption caused block production to slow, giving rise to longer transaction confirmation times. However, it did not cause the entire network to go down.

In February, the Solana network failed to produce a block for over 25 minutes. This was the latest of several Solana crashes, which some users have heavily criticized.

Magazine: Suspicious arrest of crypto scam reporter, Japan’s pro-crypto PM: Asia Express

1 minute letter

Subscribe to daily byte-sized crypto news from Cointelegraph

Subscribe
Cointelegraph publishes long-form journalism, analysis and narrative reporting produced by Cointelegraph’s in-house editorial team with subject-matter expertise. All articles are edited and reviewed by Cointelegraph editors in line with our editorial standards. Content published in here does not constitute financial, legal or investment advice. Readers should conduct their own research and consult qualified professionals where appropriate. Cointelegraph maintains full editorial independence.

More on the subject