Skip to content

test(api/rpc): add CELESTIA-202 OOM reproduction#4823

Draft
rootulp wants to merge 1 commit intocelestiaorg:mainfrom
rootulp:rootulp/celestia-202-oom-repro
Draft

test(api/rpc): add CELESTIA-202 OOM reproduction#4823
rootulp wants to merge 1 commit intocelestiaorg:mainfrom
rootulp:rootulp/celestia-202-oom-repro

Conversation

@rootulp
Copy link
Contributor

@rootulp rootulp commented Mar 5, 2026

Summary

  • Add unit tests demonstrating the unlimited JSON-RPC batch request vulnerability (CELESTIA-202)
  • Add a Docker-based reproduction that shows an actual OOM kill on a real celestia-node

Unit tests (api/rpc/server_test.go)

  • TestServer_BatchRequestLimit: sends a batch of 10K requests — server processes all without any limit
  • TestServer_BatchResponseAmplification: demonstrates 34x memory amplification (small request → large response)

Docker reproduction (api/rpc/oom-repro/)

Starts a local devnet (celestia-app validator + celestia-node bridge with 512 MB memory limit), then ramps up concurrent batch requests until the bridge node is OOM-killed.

| Concurrency | Peak Memory | % of 512 MB |
|-------------|-------------|-------------|
| Baseline    | 41.8 MiB    | 8%          |
| 1 batch     | 141.9 MiB   | 28%         |
| 2 batches   | 212.0 MiB   | 41%         |
| 3 batches   | 341.1 MiB   | 67%         |
| 4 batches   | OOM killed  | -           |

Run with: bash api/rpc/oom-repro/repro.sh

Test plan

  • Run go test -run TestServer_BatchRequestLimit ./api/rpc/
  • Run go test -run TestServer_BatchResponseAmplification ./api/rpc/
  • Run bash api/rpc/oom-repro/repro.sh and verify OOM kill

🤖 Generated with Claude Code

Add unit tests and a Docker-based reproduction for the unlimited
JSON-RPC batch request OOM vulnerability (CELESTIA-202).

Unit tests (server_test.go):
- TestServer_BatchRequestLimit: verifies the server processes
  unlimited batch requests without any limit
- TestServer_BatchResponseAmplification: demonstrates memory
  amplification where a small request triggers large responses

Docker reproduction (oom-repro/):
- docker-compose.yml: local devnet with celestia-app validator
  and celestia-node bridge (512 MB memory limit)
- attack.go: ramps up concurrent batch requests until OOM
- repro.sh: orchestrates build, startup, attack, and OOM detection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the external Issues created by non node team members label Mar 5, 2026
@rootulp rootulp self-assigned this Mar 5, 2026
@rootulp
Copy link
Contributor Author

rootulp commented Mar 5, 2026

I tried running this and it did demonstrate increased memory usage. The Docker graphs disappear as soon as the bridge node OOMs so I couldn't capture anything beyond these:

Screenshot 2026-03-05 at 11 37 57 AM Screenshot 2026-03-05 at 11 38 52 AM

but the Docker Bridge node has way less memory than our hardware requirements so it may be much more difficult to OOM a node with 64 GB of memory.

Ref: https://docs.celestia.org/operate/getting-started/hardware-requirements/#non-archival-data-availability-nodes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Issues created by non node team members

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant