Solana rBPFにおける新たな整数オーバーフローバグが発見される

Solana rBPFにおける新たな整数オーバーフローバグが発見される

最近、当社の脆弱性検出システムは、Solana の rBPF(Solana dApps がすべて実行されている仮想マシンです。https://github.com/solana-labs/rbpf)に重大な問題を発見しました。慎重な調査の結果、これは整数オーバーフローのバグであり、Solana ネットワーク全体をクラッシュさせるために悪用される可能性があることが判明しました。このバグを Solana セキュリティチームに報告したところ、チームは直ちに事態を把握し、バグの確認と修正に奔走しました。本稿執筆時点では、ほぼすべてのバリデーターノードがパッチを受け取り、最新バージョンにアップグレードしたため、公開開示しても安全な状態です。

eBPF と rBPF

Extended Berkeley Packet Filter(eBPF[1]、https://en.wikipedia.org/wiki/Berkeley_Packet_Filter)は、当初カーネルでのパケットフィルタリングのために開発されました。eBPF のセキュリティ、効率性、スケーラビリティにより、現在ではネットワーキング、トレーシング、プロファイリングなど、さまざまな分野で使用されています(etc[2])。eBPF の豊富な機能性を考慮し、Solana はスマートコントラクトの実行エンジンとしても採用しています。Solana 上で dApp を開発するには、開発者は Rust でスマートコントラクトを開発し、それが eBPF バイトコードにコンパイルされる必要があります。

Solana の dApp をホストするには、eBPF 用の正確な仮想マシンが必要です。この場合、Solana は rBPF、つまり Rust で書かれた eBPF 用の仮想マシンを使用します。しかし、提案された仮想マシン(つまり rBPF)が堅牢で、安全で、正確であるかは未知数でした。rBPF にセキュリティ上の問題が存在すると、rBPF を含むすべてのバリデーターに影響が及ぶ可能性があり、Solana ネットワーク全体に多大な損失(例:DDoS 攻撃)をもたらす可能性があります。

バグの根本原因

rBPF のバグを特定するためのツールを開発しました。このツールは現在も開発中です。このプロセス中に、rBPF(バージョン 0.2.16)でネットワーク全体をダウンさせる可能性のある深刻な問題が特定されました。

具体的には、elf.rs ファイル内の load 関数は、ELF ファイル(スマートコントラクト)を解析および検証するために使用されます。まず、load 関数は ELF 構造を読み込み、relocate 関数を呼び出して、呼び出し元オフセットを設定します。しかし、relocate 関数では、sym.st_value 属性が ELF ファイルから直接取得されます。「st_value」が大きい場合、「sym.st_value」と「refd_pa」の合計である「addr」を計算する際に整数オーバーフローがトリガーされる可能性があります。

この場合、攻撃者は悪意のある ELF ファイルをスマートコントラクトとして作成し、整数オーバーフローをトリガーすることができます。その後、すべてのバリデーターがターゲットの ELF ファイルを実行し、rBPF は「add with overflow」でパニックを起こします。

この時点で、rBPF はハングアップし、受信したトランザクションは実行されなくなるため、DoS 攻撃につながります。以下に示すように、ELF ファイルのロード中に発生した整数オーバーフローにより、ノードが「Finalizing transaction」でハングアップしていることがわかります。

この問題は https://github.com/solana-labs/rbpf/pull/200 で導入されたものであり、rBPF はバージョン 0.2.14 から脆弱であったことを意味します。この問題を特定し、2021 年 12 月 6 日に Solana セキュリティチームに報告しました。Solana は、報告後数時間で safemath 機構を使用して問題を修正しました。修正は https://github.com/solana-labs/rbpf/pull/236 にあります。本稿執筆時点(2021/12/30)では、86% 以上のバリデーターが最新バージョンにアップグレードしています。

[1] https://en.wikipedia.org/wiki/Berkeley_Packet_Filter

[2] https://ebpf.io/

タイムライン

  • 2021/12/06: Solana セキュリティチームに問題が報告されました。
  • 2021/12/06: 脆弱性が修正されました。
  • 2021/12/30: この脆弱性の情報が公開されました。
  • 2022/01/28: CVE-2021–46102 が割り当てられました。
Sign up for the latest updates
Weekly Web3 Security Incident Roundup | Feb 9 – Feb 15, 2026

Weekly Web3 Security Incident Roundup | Feb 9 – Feb 15, 2026

During the week of February 9 to February 15, 2026, three blockchain security incidents were reported with total losses of ~$657K. All incidents occurred on the BNB Smart Chain and involved flawed business logic in DeFi token contracts. The primary causes included an unchecked balance withdrawal from an intermediary contract that allowed donation-based inflation of a liquidity addition targeted by a sandwich attack, a post-swap deflationary clawback that returned sold tokens to the caller while draining pool reserves to create a repeatable price-manipulation primitive, and a token transfer override that burned tokens directly from a Uniswap V2 pair's balance and force-synced reserves within the same transaction to artificially inflate the token price.

Top 10 "Awesome" Security Incidents in 2025

Top 10 "Awesome" Security Incidents in 2025

To help the community learn from what happened, BlockSec selected ten incidents that stood out most this year. These cases were chosen not only for the scale of loss, but also for the distinct techniques involved, the unexpected twists in execution, and the new or underexplored attack surfaces they revealed.

#10 Panoptic Incident: XOR Linearity Breaks the Position Fingerprint Scheme

#10 Panoptic Incident: XOR Linearity Breaks the Position Fingerprint Scheme

On August 29, 2025, Panoptic disclosed a Cantina bounty finding and confirmed that, with support from Cantina and Seal911, it executed a rescue operation on August 25 to secure roughly $400K in funds. The issue stemmed from a flaw in Panoptic’s position fingerprint calculation algorithm, which could have enabled incorrect position identification and downstream fund risk.