Skip to main content
Blog
Blog

Cosmic Ray Bit Flips and the Hidden Risk at Scale

When a 1 in a million rare occurrence, turns out not to be so rare. How our atmosphere changes zero to ones and how it can impact security.

Aug 08, 2025 Updated Jul 19, 2026 6 min read
blog-cover-cosmic-ray-bit-flips
Table of Contents

TL;DR: cosmic ray bit flips

  • Cosmic rays cause single-event upsets (SEUs) that flip bits in memory at a rate of roughly one per gigabyte per month at sea level. At planet scale, this is not a rare curiosity.
  • Famous bit-flip incidents include a Belgian election voter miscounted by 4,096 votes (2003), and the Super Mario 64 speedrun 'Upwarp' skip caused by a single flipped bit. Both are consistent with cosmic-ray SEU probability at exposure duration.
  • At web-application scale, cosmic-ray bit flips are one of the small residual causes of unreproducible bugs. ECC memory, checksummed storage, and idempotent request handling are the practical mitigations.

Short on time? See cside's in-browser Magecart and skimmer blocking. It covers everything below in one deployment.

In 2013, competitive Super Mario 64 speedrunner DOTA_Teabag was running through Tick Tock Clock, a level infamous for punishing even the best of players due to a challenging sequence of jumps. While making their way through, Mario suddenly shot directly upwards through the floor, bypassing a full section of the level and saving DOTA_Teabag precious seconds.

Super Mario 64 Bitflip Incident video

TTC Upwarp: Ceiling Warp vs Byte Change

The speedrunning community, which had been playing and dissecting Super Mario 64 for decades, was stunned. A bounty was offered to reproduce the glitch; some speedrunners claimed that DOTA_Teabag had "rocked the cartridge" (a way to sometimes predictably glitch a Nintendo 64 game by slightly modifying the angle of the game cartridge). The mystery came to a close when YouTuber and esteemed video game glitch hunter pannenkoek12 (translated 'Pancake12') discovered that a single bit in the Nintendo 64's memory was the cause. The bit flip happened at 0xC5837800, the address responsible for Mario's vertical position. The change in binary was from 1100 0101 to 1100 0100, and by extraordinary luck, the exact change needed to warp Mario onto a higher platform.

So what caused this in the first place? All signs point to a cosmic ray bit flip, a random error in computer chips caused by a high-energy particle from space that happens to affect a system right at a particular time.

Illustration of a cosmic ray bit flip striking a computer memory chip

What is a cosmic ray bit flip?

A cosmic ray bit flip (also called a "single-event upset", or SEU) occurs when a stray ionizing particle from a cosmic ray in space strikes a single memory cell or transistor, flipping a binary bit from 0 to 1, or 1 to 0. These bit flips can cause a soft error, which leaves no physical damage to the hardware, but they can alter data stored in memory or logic adjusting application behaviours or even disabling security features.

The Super Mario 64 speedrun isn't the only affected documented case of a cosmic event having on-Earth effects. During the 2003 Belgian election, an unknown candidate received exactly 4,096 extra votes seemingly out of nowhere on the country's electronic voting machines. The error was only caught because she received more votes than the number of voters, making it mathematically impossible.

Upon investigation, researchers concluded that a cosmic ray had flipped single bit at position 13 in the voting machine's memory, giving the candidate 4,096 extra votes [1]. In binary, each bit doubles the value, so the bit at that position was computed to be 2^12 - or exactly 4,096.

Rare doesn't mean impossible, especially at scale

These cosmic ray bit flips are incredibly rare on a per-bit basis, but they're not impossible. In 1996, researchers at IBM estimated that a typical desktop with 256 megabytes of RAM could experience one cosmic-ray-induced bit flip per month. Fast forward to today, where modern systems commonly run with 16 gigabytes of RAM (62.5x more than the study!), and the risk scales accordingly. Combine that with millions of cosmic rays hitting the Earth every second, and it's only a matter of time before one hits the wrong bit at the wrong time. Researchers at Vanderbilt University confirmed this: their research found that an internet service provider's router farm with 25 gigabytes of memory could experience a bit flip up to every 17 hours [2].

A "one in a million" event will happen daily if you do a million-plus things a day. Here at cside, we scan roughly over 10 million scripts every 24 hours for malicious behavior. Even if a bit flip error has a one-in-100-million chance, scanning at that volume means these impossible odds are, in fact, quite possible.

While enterprise grade memory may not be subjected to cosmic ray bit flips anymore through adoption of error-code correcting memory, which can often detect and correct single-bit errors, consumer hardware isn't usually protected. In a world where millions of actions happen, 'rare' just means it's a matter of time.

Cosmic hardening and embracing resilience

Given that cosmic bit flips are a game of statistics, how can systems be built that expect the unexpected? The answer lies in engineering for fault tolerance. For example, NASA spacecraft run critical calculations in triplicate - multiple processors run the same operation, and if one disagrees due to a stray bit flip, the other two out-vote the process. Back home on Earth, ECC memory can play a role in safeguarding routers, servers, and cloud infrastructure against single-bit errors (and even sometimes detect two-bit errors!). But like everything, ECC memory has its own limitations. It doesn't typically protect the CPU register, GPU memory, or network buffers. Even in enterprise environments equipped with ECC memory, multi-bit flips or logic-level faults can go undetected. That's why a layered resilience strategy matters. At cside, we apply the same philosophy to client-side security. Even though a malformed script or edge-case exploit may be rare individually, scanning millions of JavaScript files daily means they're not rare in aggregate.

At scale, cosmic ray bit flips are a matter of probability, not certainty. A one-in-a-million event becomes inevitable once a system runs billions of operations, whether that system is a database, an election machine, or a client-side browser. On the client side, unpredictability scales with volume, so security systems need to assume something will eventually fail, and be built to catch it when it does.

References:

[1] https://web.archive.org/web/20070927185155/http://wiki.ael.be/index.php/ElectronicVotingRandomSpontaneousBitInversionExplained

[2] https://www.independent.co.uk/news/science/subatomic-particles-cosmic-rays-computers-change-elections-planes-autopilot-a7584616.html

Jack LaFond
Security Researcher

I'm a security engineer + security researcher at cside.

FAQ

Frequently Asked Questions

A single-event upset, or SEU, is a soft error where a high-energy particle, often from a cosmic ray, strikes a memory cell or transistor and flips a single binary bit from 0 to 1 or 1 to 0. It leaves no physical damage to the hardware, but it can silently corrupt stored data or alter logic, changing how an application behaves or even disabling a security feature until the affected memory is rewritten.

On a per-bit basis they are extremely rare, but the aggregate rate is not trivial. A rough industry estimate puts it near one flip per gigabyte of RAM per month at sea level. IBM researchers estimated that a mid-1990s desktop with 256 MB of memory could see about one per month, and Vanderbilt University found that a 25 GB router farm could experience one roughly every 17 hours. More memory and more machines mean more flips overall.

No. Error-correcting code (ECC) memory detects and corrects most single-bit errors and can flag some double-bit errors, which makes it valuable for servers, routers, and cloud infrastructure. But it does not typically cover the CPU registers, GPU memory, or network buffers, and multi-bit or logic-level faults can slip past it. Consumer hardware usually has no ECC at all. ECC is one important layer of defense, not a complete guarantee against every soft error.

They engineer for fault tolerance instead of assuming perfect hardware. Common measures include ECC memory, checksummed or hashed storage that catches corruption on read, idempotent request handling so a repeated operation cannot double-count, and redundant computation. NASA spacecraft, for example, run critical calculations on multiple processors and let two agree to out-vote a third that disagrees. The goal is to detect and recover from errors, not to pretend they never occur.

Assume that at enough volume something will eventually fail, and build to catch it rather than to prevent every possible case. Practical patterns include validating inputs and outputs, checksumming data in transit and at rest, making writes idempotent, logging enough context to investigate a one-off event, and monitoring for anomalies you cannot reproduce on demand. A one-in-a-million event becomes routine once a system runs millions of operations a day, so resilience beats chasing certainty.

It depends on where your risk sits. ECC memory is the first move for servers and long-running infrastructure that hold state in RAM. Checksums and hashes matter most for data that moves or persists, since they catch corruption ECC cannot see once data leaves memory. Redundant computation suits safety-critical calculations that must not silently go wrong. Most mature systems layer all three rather than picking one, because each covers a gap the others leave open.

They are a small residual cause, far behind race conditions, memory bugs, flaky tests, and environmental differences. Chase the common explanations first. Treat a hardware soft error as a candidate only after you have ruled out reproducible software faults and confirmed the symptom is a single, non-recurring bit change consistent with SEU probability at your exposure. At planet scale, though, that small residual still surfaces regularly, so do not dismiss it entirely.

cside scans roughly over 10 million scripts every 24 hours, so it is built on the same assumption this article describes: at that volume, rare failures are inevitable and must be caught rather than wished away. The platform treats a malformed script or edge-case exploit as something that will appear in aggregate even when any single one is unlikely, and its scanning pipeline is designed to flag anomalous third-party script behavior rather than trust that every input is well-formed.

Yes, that is the core of the design. cside fetches and analyses third-party scripts on its side and hashes their real-session payloads, so a change that only fires under specific conditions still shows up as a difference from the known-good version. Because a one-in-a-million behavior becomes common at millions of scripts a day, the platform assumes edge cases will occur and is built to surface them rather than sample a subset and hope the rest is clean.

cside deploys as a single first-party JavaScript tag, or the agentless Scan Method, with no DNS change. It does not sit in front of your traffic and does not route or proxy your visitors. Instead it fetches and analyses the third-party scripts on cside infrastructure and reads script behavior in the real session, so the heavy analysis happens on cside's side while your pages continue to load normally for your users.

You add one lightweight first-party JavaScript tag to your site, with no DNS change and nothing routed through cside. If you prefer not to add a script at all, the agentless Scan Method can monitor your pages externally. From there cside fetches and analyses your third-party scripts and watches their real-session behavior for tampering or skimming, so client-side coverage starts quickly without re-architecting how your site serves traffic to visitors.

cside is metered on usage, typically by session or pageview volume, with tiers that scale as your traffic grows and a free plan to start. There is no charge tied to adding a DNS change or a proxy, because cside uses neither. For a quote matched to your traffic and the coverage you need, the best step is to talk to the cside team rather than guess from a fixed list price.

Monitor and Secure Your Third-Party Scripts

Gain full visibility and control over every script delivered to your users to enhance site security and performance.

Start free, or try Business with a 14-day trial.

cside dashboard interface showing script monitoring and security analytics
Related Articles
Book a demo

Want to walk through this with an engineer?

Thirty minutes, on your own site. Not a slide deck.

Book a personalized demo to see:

How to achieve PCI DSS requirement 6.4.3 & 11.6.1 compliance in 1 day
Why third-party scripts are a security risk for you and your visitors
Monitoring privacy and consent leakage (GDPR, CCPA) across every third party
Stopping signup abuse, account sharing, and chargeback fraud with device intelligence
Detecting and controlling AI agents and bots hitting your site in real time

Rather just send a question?

Finding open slots…

Real humans only. We'd know.

Having trouble booking? Open scheduler in a new tab

What are you trying to solve?

Tell us in a line and we'll come back with something useful, not a generic pitch.

We usually help with:

Seeing which third-party scripts run on your site
PCI DSS 6.4.3 and 11.6.1 evidence
Bots, AI agents and account takeover

Prefer to just book a time? Pick a slot instead