monero.loveA little love for the network.
← All guides

Mining / Monero / Security

Bitcoin's BGP Hijacking Attacks Expose a Weakness in Cryptocurrency Mining

Bitcoin mining traffic was redirected through BGP hijacking. See what XMRig certificate pinning, P2Pool, authenticated TLS and RPKI can protect.

Two paths from miner to pool address, one reaching the pool and one reaching an impersonator

The mining rigs kept drawing power and reporting full hashrate. On the pool dashboard, their credited work dropped to zero. In November 2026, some Bitcoin miners reconnected to their usual pool address and began doing work credited elsewhere. Braiins disclosed the campaign on November 25.

What Braiins observed

Date (UTC) Region Episodes Reported impact per episode
Nov 7 to 12 Latin America 19 120 to 400 sites, 36 to 174 PH/s
Nov 16 Brazil 1 captured Three monitored miners
Nov 20 Mostly Europe 4 1,050 to 1,600 sites, 0.6 to 1.9 EH/s

Sites could recur across episodes. Braiins recorded synchronized disconnects, unchanged hostnames and IP addresses on reconnect, and difficulty settings outside its pool records. In the Brazilian capture, the substitute server answered faster. Job data pointed to another public pool, which Braiins inferred received shares under the attacker's account. A pool can accept valid work through an ordinary account without knowing its origin. Braiins reported no compromise of its pool.

On November 20, the route appeared four times for six to 49 minutes. The address holder told Braiins it never announced the route. RIPE RIS updates corroborate the four routing windows. Earlier episodes lack comparable routing evidence. On November 22, RIS recorded similar announcements on one prefix and a second prefix shared with unrelated services. The updates establish routing changes. Further mining losses remain unverified. Dell SecureWorks documented mining redirection in 2014.

BGP routing and the pool's IP

An autonomous system is a network or group of networks under one routing policy, identified by an ASN. Systems use BGP to advertise which IP prefixes they can reach and propagate selected routes to neighbors under local policy. When forwarding a packet, a router uses the most specific matching prefix in its forwarding table. On November 20, the disputed route covered 256 addresses inside a legitimate block of 4,096. Routers that installed both sent traffic for the smaller block along the more specific route.

A route hijack falsely claims reachability. With a route leak, a network passes a route outside its intended policy scope. DNS poisoning changes the address lookup. BGP hijacking can divert packets while leaving the lookup and destination IP intact. The miner still needs to verify the server's identity.

Stratum and endpoint identity

Bitcoin's Stratum V1 uses JSON messages for jobs, worker authorization and share submissions. Miners send shares to show that they found hashes meeting the assigned difficulty. A worker login identifies the worker to the server. The miner needs a separate check to authenticate the pool.

Plaintext exposes the session. TLS without verification encrypts it to whoever answers. With chain and hostname verification, the client checks that a trusted authority vouched for the intended hostname. A certificate pin checks the exact expected certificate instead. Braiins tested seven firmware implementations and reported that two with TLS options accepted invalid certificates.

Plaintext exposes traffic, unverified TLS encrypts to an unknown endpoint, and authenticated TLS checks the expected server.

Stratum V2 uses a Noise handshake and a configured pool authority key to authenticate the server. Bitcoin miners gain integrity and confidentiality over untrusted routes. The reference libraries target Bitcoin. XMRig, XMRig Proxy and P2Pool document no compatible Monero mode. Standardizing authenticated transport for Monero would require separate protocol and implementation work.

Where Monero miners need authentication

Braiins' evidence concerns Bitcoin. Monero's transaction privacy protects information on the chain, and RandomX defines the mining computation. Miners still depend on authenticated endpoints, accurate routing and reachable services for jobs, shares and block data.

Monero mining paths show separate Stratum links to a pool or proxy, and separate P2Pool sidechain, daemon RPC, ZMQ and Monero peer links.

XMRig and XMRig Proxy

XMRig's pool settings control transport per entry. In the Stratum TLS implementation, enabling TLS alone leaves chain and hostname unchecked. A configured SHA-256 certificate fingerprint must match before login. SNI sends the hostname the client wants to reach. Certificate verification is a separate check.

JSON
{
  "pools": [{
    "url": "stratum+ssl://pool.example:443",
    "user": "YOUR_PUBLIC_XMR_ADDRESS",
    "pass": "x",
    "sni": true,
    "tls-fingerprint": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
  }]
}

Replace the sample pin with the pool's leaf certificate fingerprint from an independently authenticated operator channel. Confirm worker naming with the pool. Plan certificate rotation in advance. XMRig normally retries five times with five seconds between retries. The Stratum client reconnects with the same transport settings and can switch to a separately configured plaintext backup.

XMRig Proxy supports server TLS on its miner-facing listener and TLS with certificate pinning upstream. Miners must authenticate the proxy separately. A public listener can admit unauthorized clients and expose a shared point of failure. Bind it to a private interface and limit which sources can connect. Keep the management API local or behind authenticated access.

P2Pool and monerod

P2Pool validates shares across a separate peer network and pays eligible addresses directly in Monero block rewards. Main, Mini and Nano are separate sidechains. With XMRig and P2Pool on one host, bind Stratum to loopback. Remote miners can pin the server certificate on TLS-enabled builds or use an authenticated tunnel. The native listener can also accept plaintext.

P2Pool uses monerod RPC for mining data and block submission. A stale or unreachable daemon can waste work. P2Pool's RPC TLS client needs a Base64 SHA-256 public-key pin for authentication. Its separate ZMQ update feed uses plain TCP, so protect it with an authenticated tunnel across untrusted networks. P2Pool and Monero peer networks exchange different blocks and enforce their own consensus rules. A partition can delay valid shares or blocks. An eclipse can isolate a node behind attacker-controlled peers. Redirecting a miner's jobs does not by itself change either network's consensus rules. P2Pool source.

Monerod supports HTTP RPC TLS and RPC login. Require TLS for remote HTTP RPC when the client supports certificate verification, or use a private authenticated tunnel. Restricted RPC limits methods. Keep mining RPC private and ZMQ bound to loopback or a protected network. Public nodes are shared services. Remote node trust and Tor or I2P transaction relay involve different connections.

RPKI and what origin checks miss

The Resource Public Key Infrastructure lets address holders publish Route Origin Authorizations specifying an ASN, prefix and permitted maximum length. Route origin validation marks an announcement valid when a covering authorization matches both origin and length, invalid when covered but none matches, and not found when none covers it. Operators choose what to reject. Origin validation checks authorization for the origin and prefix length. The rest of the path remains unverified. Pool identity still depends on authenticated transport. RFC 6811, RFC 8481.

Braiins reported that origin-validating networks rejected the November 20 route even though it showed the expected origin ASN. An origin-change alert could miss the unauthorized more-specific prefix. ASPA uses signed provider relationships to check path properties. RIPE RIS and Route Views show routes from participating networks.

Detecting diverted mining work

Compare signals on one UTC timeline. Align sampling windows before comparing XMRig dashboards with pool hashrate estimates or P2Pool Watch. Set alerts against the pool's normal behavior.

Warning in Prometheus or Grafana What to check
Steady local rate, falling credited rate or payout Compare accepted shares, accounting window and payout history
Resets, then rapid reconnects Compare pool logs, round-trip time and collector updates
Difficulty jump or more stale and rejected shares Check pool settings, job age and upstream latency
Changed or expiring certificate Confirm rotation with the operator before updating pins

Short episodes can disappear in share variance and payout averages. Victims still pay for power and lose the expected revenue from diverted work. Fees may shift to the receiving pool. Existing wallet funds stay under their owners' keys. Shared proxies and hosting concentrate exposure. Certificate rotation and independent monitoring take operator time and help prevent or detect silent diversion.

Defenses by operator

  • Individual miners. Pin each XMRig TLS endpoint, check backups for plaintext and reconcile credited work.
  • P2Pool operators. Keep RPC, ZMQ and local Stratum private. Authenticate remote links and track peer counts and share freshness.
  • Proxy operators. Secure both legs and restrict listener and API access.
  • Pools and network operators. Offer authenticated endpoints without plaintext fallback. Coordinate scoped ROAs with upstreams, reject RPKI-invalid routes, filter customer prefixes and alert on more-specific announcements and unexpected paths.

Support Monero Love

Help keep the public nodes and packages running. Send any amount of XMR.

Scan with a Monero wallet to donate to Monero Love.89hGTKxRVA3AUeKAbCRBt5TMSzq3MQZooNNsezCpNFjp2oeJPRx8AJeGKA8ziHZNqab78f4Vr1ntxhPDxX5298nnGZjHkhm