Stratum V1 hashrate hijacking, explained

Stratum V1 hashrate hijacking, explained

Braiins published a warning this week about Stratum V1 hashrate hijacking: an attacker impersonated mining pools at the internet routing layer and struck more than 1,000 sites in a single second. No malware on the miners, no breach inside the pool company. The attacker simply got between the miner and the pool, and the protocol had no mechanism to tell an impostor from the operator.

The gap that makes that possible is the whole story, so I will stay on it.

What the hijack actually did

Stratum V1 distributes work over a plain TCP stream. The miner connects to the pool’s address, sends mining.subscribe to request job templates and mining.authorize to attach a worker name, and everything on that wire is line-delimited JSON. Nothing in the handshake proves the listener is the pool. A miner that receives plausible mining.notify messages cannot tell whether the templates came from the real pool or from whoever owned the route at that moment.

An attacker in the middle can keep hashrate dashboards green while taking the money. The method fits in one sentence: forward the miner’s shares upstream to the genuine pool so accepted share counts and difficulty look normal, and rewrite the coinbase payout address in the block templates handed back to the miner. Blocks the fleet finds then pay the attacker’s address. The operator watches a healthy mining.notify cadence, normal share acceptance, and payouts that stop arriving. That is the shape Braiins described, in the report Decrypt covered, and the timing gives away the transport: touching more than a thousand sites in a single second is not malware propagation. It is a route change taking effect.

The protocol trusts whatever IP answers

You have seen this failure shape before if you follow the boring infrastructure posts here. A garage door on this site rebooted because DNS failed, and the lesson was identical: a system that identifies its peer by network position instead of by identity inherits every resolver and routing bug on the path. Stratum V1 compounds the problem by shipping plaintext, so whoever holds the route can read, drop, or rewrite the stream without breaking anything visible.

Port 3333 is the default. Plenty of pools also listen on 3334, and some put V1 behind 443 to squeeze through restrictive firewalls. And note that encryption is not the same as authentication, which is why MASQUE doesn’t make a tunnel unblockable either: the transport tells you far less about who sits at the other end than people assume.

A route hijack wins in seconds

The routing side needs no exploit at all. An attacker announces a more-specific prefix that covers the pool’s IP range, and internet routers prefer the more-specific path, so new TCP handshakes from miners land on the attacker’s host. Miners hold long-lived connections rather than re-resolving every hour, which means the hijack keeps them for as long as the route survives. No CVE, no patch, no buggy miner build to fix. Route announcements of this kind work against any service that trusts the destination IP, and that is why the technique keeps resurfacing against things that never bothered with endpoint authentication.

How to spot Stratum V1 hashrate hijacking

Dashboards won’t save you, because the attacker’s job is to keep them green. Three checks carry information. First, compare hashrate against payouts over days rather than hours; a hijack pays in coinbase rewrites, so hashrate holds steady while earnings sag. Second, watch share submission latency and difficulty churn, which degrade when a middleman has to shuttle work to the real pool. Third, ask the miner itself where its connection ends: witr traces a port back to the process that opened it, and the remote address on that socket tells you who your fleet believes it is talking to.

On the wire the giveaway is plaintext. A few seconds of capture on your miner’s uplink shows the entire job stream, coinbase included:

tcpdump -i eth0 -A -s0 'tcp port 3333 and host POOL_IP' | grep -m 3 mining.notify

If that prints JSON on a network you do not fully control, any operator who wins the route can impersonate your pool.

From the miner’s side, a middleman and an outage look the same, which is the same trap as correct-looking bugs that left a closed socket open for days: nothing on the surface disagrees with the design. Operators blame the pool first, and Stratum V1 gives them no way to tell a hijack from a maintenance window from inside the client.

Stratum V2 fixes most of this

The Stratum v2 specification answers each of these gaps: TLS for transport, an optional certificate pinning mode so a miner can demand the pool’s known key, and separate channels for job distribution and share submission. The design is years old and the drafts have been stable a long time, yet adoption crawled, because pool operators own the client update path and the old protocol keeps working. That is the uncomfortable part. The fix exists, it costs nothing extra, and the industry still ships miners configured for a 2012-era handshake.

PropertyStratum V1Stratum V2
Transportplain TCPTLS
Pool identitywhatever answers the portcertificate, pinnable by the miner
Work streamone JSON channel for jobs and sharesseparate job and share channels
Impersonation costwinning the routeholding the route and forging the handshake

The last row is the point. Both protocols fail if the attacker controls the path, but V2 turns a silent rewrite into a visible handshake failure, and visible failures get escalated instead of billed to the operator for months.

Once your protocol identifies the pool by destination address alone, your security budget is a BGP budget, and you are not the one spending it.

What to change on a fleet this week

None of this requires new hardware or a protocol migration to start. Four moves, in order of how cheap they are:

  • Pin the pool’s IP addresses in miner configuration wherever the firmware allows it, so a resolver change cannot silently reroute traffic.
  • Alert on payouts, not hashrate. A seven day window with earnings lagging hashrate catches coinbase rewrites that a hashrate graph never shows.
  • Run one reference miner outside your main egress path, so a hijack of your prefix alone cannot impersonate the pool to both.
  • Ask the pool vendor, in writing, for Stratum v2 support dates. Pools answer to their customers, and silence on that question is itself an answer.

My working prediction for the rest of this cycle: the next incident of this family hits a smaller pool running Stratum V1 on a single IP with no certificate anywhere in its stack, because the marginal cost of hijacking one prefix is close to zero. The window between the fix being published and fleets actually moving will be measured in months, and every month of it belongs to the attacker.

Press ⌘K to search & switch themes