Skip to content
DoS Write-up Advanced

Avalanche remote network crash

A message unpacking routine accepted an empty x509 certificate and returned nil instead of rejecting it, so a malicious peer could send a crafted PeerList packet that caused the receiving node to dereference a nil certificate and crash. An attacker could run a malicious node or validator to take down nodes across the Avalanche network.

Pter Szilgyi Follow

Published on gist.github.com

Clone this repository at <script src="https://gist.github.com/karalabe/4d10a879e361bb5b85302d57c193f532.js"></script> - Save karalabe/4d10a879e361bb5b85302d57c193f532 to your computer and use it in GitHub Desktop.

Pter Szilgyi (@peter_szilagyi), on gist.github.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Root cause

The certificate unpacking function returned nil for an empty byte slice instead of reporting a bad length, and the caller did not check for nil before using the certificate.

Impact

A single malicious connection could crash a node, and a malicious validator could crash the entire network; the report notes nodes behind a restart daemon would only crash again.

What the attacker needed

Ability to connect to a node; modified node software or crafted packets; for full network impact, a validator stake

The fix

The vulnerability was patched by adding a bad-length check in the certificate unpacking routine, and the fix was released in avalanchego v1.7.9.

How it was found

  1. Modify the outbound message builder so that PeerList packets contain a hand-crafted byte sequence with an empty certificate.
  2. Build the modified Avalanche node software.
  3. Adjust the local test network tool so that stderr from child nodes is always printed.
  4. Run the local example network with the modified nodes and observe the panic.

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 write-up has not been written yet. The Original tab links to the source.

When two computers in a network talk, they send each other structured messages. One part of the software that reads these messages was supposed to reject an empty certificate (a digital identity document) but instead passed it on as 'nothing'. Later code tried to use that 'nothing' as if it were a real certificate, which made the program crash. Because every node accepts connections from other nodes, one bad message could knock a node offline.

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.

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.