Skip to content
DoS Write-up Advanced

Claiming Bitcoin's Bug Bounty

LevelDB on Mac OS X could corrupt its database because dirty pages from memory-mapped I/O were discarded on unmap without being flushed to disk. This prevented Bitcoin users from storing the block chain and participating in the network.

hackingdistributed.com

Published on hackingdistributed.com

leveldb bitcoin November 27, 2013 at 04:53 PM Robert Escriva

The author, on hackingdistributed.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

Likely the munmap call on Mac OS X discards dirty pages at the tail of a memory-mapped region without flushing them to disk, leaving zero-filled holes in the output file.

Impact

Users affected by the bug could not store the block chain or participate in the Bitcoin network, and the corruption could cause block checksum mismatches or missing fragments in log files.

What the attacker needed

Mac OS X; LevelDB used as storage backend

The fix

The short-term fix was to always sync data to disk before calling munmap, and a patch was proposed for OS X.

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.

LevelDB is a storage library used by Bitcoin to keep its data on disk. On Mac OS X, when the program finished writing a chunk of data, the operating system sometimes threw away the last part before saving it, leaving zeros in the file. That made the database unreadable and stopped Bitcoin from working.

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.