XRPL Patches Decade-Old Bug That Could Have Created New XRP

iconTheCryptoBasic
Share
AI summary iconSummary
The XRP Ledger (XRPL) has completed a network upgrade to fix a critical flaw that could have allowed the creation of new XRP beyond the 100 billion supply cap. The bug, dating back to 2015, was reported via the bug bounty program and patched in xrpld 3.4.1 just three days later. The vulnerability involved a payment engine overflow that could have enabled an attacker to generate new XRP through order book manipulation. No Mainnet exploitation was detected. The fix bypassed the normal amendment process, with over 80% of validators adopting the emergency release within 24 hours. The swift action highlights the importance of ongoing network upgrades and supports the ledger’s stability ahead of potential new token listings.

XRP Ledger (XRPL) patched a decade-old overflow flaw that could have created spendable XRP beyond the 100 billion supply cap, with no evidence of Mainnet exploitation.

The XRP Ledger has patched a critical flaw that could have allowed a deliberately constructed payment to create spendable XRP beyond the network’s fixed supply.

The bug had apparently been sitting inside XRPL’s payment engine since 2015 before researchers uncovered it through the network’s bug bounty program.

The issue was reported on Sept. 22 and fixed three days later in xrpld 3.4.1, an emergency release.

RippleX engineers reproduced the exploit on a standalone server and confirmed that the newly created XRP could subsequently be spent.

Importantly, the investigation found no evidence that the vulnerability was ever exploited on XRPL Mainnet or another public network.

XRP was created with a maximum supply of 100 billion, and XRPL rules are designed so no additional XRP can be minted.

How the XRP Creation Bug Worked

The flaw involved payments that consumed large numbers of offers from XRPL’s built-in order book.

An attacker could create hundreds of accounts and have each one offer a tiny amount of another token in exchange for an unusually large amount of XRP.

A specially constructed payment could then sweep through all those offers at once.

The payment engine used a 64-bit integer to add up how much XRP the buyer owed. With enough extreme offers, the total could exceed the maximum value the counter could hold.

Rather than rejecting the calculation, the number wrapped around to a tiny value.

The offer accounts would still receive their full XRP amounts, while the buying account would be charged only the wrapped total. The difference effectively became new XRP that had never existed before.

The attack was also relatively inexpensive. The official disclosure says it required only a few hundred XRP for account and offer reserves, much of which could later be recovered, plus normal transaction fees.

XRPL’s Safety Check Could Have Missed the Mint

XRPL already had an invariant designed specifically to prevent transactions from creating XRP.

However, that check used similar arithmetic when adding balance changes. It could therefore overflow in the same way, making the fraudulent transaction appear normal.

Another protection limits individual account balances, but spreading the newly created XRP across hundreds of accounts kept each balance below the threshold.

The bug could not occur through ordinary trading. It required hundreds of intentionally abnormal offers and a payment specifically designed to consume them together.

Emergency Fix Skipped the Normal Amendment Process

The response was unusual for XRPL.

Protocol changes normally go through the amendment system, requiring more than 80% validator support for two weeks before activation.

For this vulnerability, developers decided that waiting would create a larger risk because releasing the fix would also reveal where the exploit existed.

Instead, the correction became effective as individual servers upgraded to xrpld 3.4.1. XRPL says this was the first deliberate change to transaction processing shipped this way since the amendment system was introduced more than a decade ago.

Validators moved quickly. More than 80% of validators on the default UNL were running version 3.4.1 or later on Sept. 25, the same day the emergency release became available.

The fix now checks calculations for overflow before totals are accepted. XRPL also widened the counter used by its “no XRP created” invariant, providing another safeguard against similar arithmetic failures.

The full details were withheld until Oct. 9, after the network had been protected. The disclosure credits Cayden Liao and Veria AI with finding the vulnerability and submitting the proof of concept.

Disclaimer: The information on this page may have been obtained from third parties and does not necessarily reflect the views or opinions of KuCoin. This content is provided for general informational purposes only, without any representation or warranty of any kind, nor shall it be construed as financial or investment advice. KuCoin shall not be liable for any errors or omissions, or for any outcomes resulting from the use of this information. Investments in digital assets can be risky. Please carefully evaluate the risks of a product and your risk tolerance based on your own financial circumstances. For more information, please refer to our Terms of Use and Risk Disclosure.