RPC call crashes node
The get_output_distribution RPC method accepts an unbounded list of amounts, so a single request with a very large list keeps the node busy for around 90 seconds or crashes it outright. An attacker could use this to take a remote node offline or make the call unusable for others.
- Triaged in 1 hour
- Fixed in 56 days
- Disclosed after 10 months
Summary:
Passing a large list of amounts to the get_output_distribution call crashes a remote node, after maybe 90 seconds of keeping it busy.
Releases Affected:
- Probably all
Steps To Reproduce:
values=`echo $(seq 0 500 900000)|sed -e 's/ /,/g'` ; curl http://127.0.0.1:38081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts": ['$values'], "from_height": 100, "cumulative": false}' -H 'Content-Type: application/json'
Reduce the 900000 number a bit and instead of crashing the daemon, it'll do a denial of service, like 90 seconds per call, making it hard for anyone else to use that call.
Supporting Material/References:
- Unnecessary. The attack is straightforward and compelling.
Housekeeping
Payment address: ████
Impact
An attacker can crash any remote node that exposes get_output_distribution or tie up availability of that function call. I think that's serious.
What the report shows
The target is a Monero node that exposes its JSON-RPC interface. The feature in question is the get_output_distribution call, which takes a list of amounts and a starting height. The researcher found that passing a very large list of amounts to this call crashes a remote node, after roughly 90 seconds of keeping it busy. The report says the issue probably affects all releases.
The reproduction is a single shell command that builds a long comma-separated list of amounts with seq and sends it to the RPC endpoint:
values=`echo $(seq 0 500 900000)|sed -e 's/ /,/g'` ; curl http://[redacted]:38081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts": ['$values'], "from_height": 100, "cumulative": false}' -H 'Content-Type: application/json'
The researcher notes that reducing the 900000 number a little turns the crash into a denial of service instead: the call takes about 90 seconds, which makes it hard for anyone else to use that function. The report lists no supporting material, saying the attack is straightforward and compelling. It gives no fix, no bounty figure and no CVSS score. The platform records the severity as high and the weakness as uncontrolled resource consumption, and the report was disclosed on 20 August 2022.
Root cause
The report does not analyse the code path. The report does not analyse the code path or state a cause. A large enough list crashes the node. The exact resource (memory, CPU time, or both) is not stated.
Impact
As the researcher puts it, an attacker can crash any remote node that exposes get_output_distribution, or tie up availability of that call. The report hedges with "I think that's serious" rather than claiming a specific outcome beyond the crash and the slowdown. There is no discussion of persistence, data loss or recovery, and no evidence of exploitation against a third party.
How this kind of bug works
Uncontrolled resource consumption covers a family of bugs where an endpoint accepts an input whose size or complexity the server does not cap, and the cost of handling it scales with that input. Common shapes are a list or array parameter with no maximum length, a numeric parameter used directly as a loop count or allocation size, deeply nested structures that a parser expands recursively, and regular expressions that backtrack badly on crafted strings.
The mechanism is simple: the attacker controls a multiplier, and the server multiplies. A single request can then consume far more CPU, memory or time than the designer assumed. When the resource is shared across all clients, one request degrades service for everyone; when it is exhausted outright, the process or host fails. The bug class sits close to denial of service but is usually reported as its own weakness because the fix is an input limit rather than a traffic control.
Defences are limits applied before the expensive work starts: maximum array lengths, maximum numeric values, request body size caps, timeouts and per-client rate limits. Validation that rejects oversized input early is cheaper and more reliable than trying to interrupt work already in progress.
How to test for it
Look for RPC, JSON and form endpoints that accept arrays, counts, ranges or free-form strings and pass them into loops, allocations, queries or parsers. Batch endpoints, search and filter parameters, pagination sizes, import features and anything that takes a list of identifiers are good candidates.
- Establish a baseline: send a normal, small request and note the response time and status.
- Increase one input at a time: grow the array length, the numeric value or the string length in steps, and record latency and response size at each step.
- Watch for non-linear growth: if doubling the input more than doubles the time or memory, the cost is uncontrolled.
- Push to the limit on a target you are authorised to test, and observe whether the service recovers, returns an error, or stops responding.
- Confirm the effect is attributable to your input by repeating with a small request afterwards.
A positive result is a measurable, repeatable jump in latency or resource use that scales with input size, ideally with the service recovering once you stop. Common false positives are ordinary slow queries on large datasets, caching effects that make the first request slow, network jitter, and shared infrastructure noise from other tenants. Repeat measurements and compare against a control request before reporting.
How it is fixed
The standard fix is to bound the input: cap the number of elements in list parameters, cap numeric values used as counts or ranges, and reject anything above the limit with a clear error before doing work. Request body size limits at the HTTP layer catch oversized payloads early. Server-side timeouts and memory limits contain the damage if a limit is missed. Rate limiting per client reduces the ease of repeated abuse but does not replace input validation. Where the expensive operation is unavoidable, moving it off the request path or chunking it keeps the service responsive.
Hunting notes
This bug class tends to hide in administrative and internal RPC interfaces, batch APIs, export and report generators, search backends, and any endpoint added for tooling rather than end users. Recon signals include JSON-RPC endpoints, parameters named like amounts, ids, heights, range, limit or count, and documentation that describes array inputs without stating a maximum.
To get a report accepted, show the smallest input that produces the effect, the measured difference against a baseline, and a clear statement of what an attacker gains: service unavailability for other users, a crashed process, or a call made unusable. Keep testing within the program's rules, avoid sustained attacks on production, and stop as soon as you have reproducible evidence.
What happened, in plain words
Monero is a cryptocurrency, and like most cryptocurrencies it runs on a network of computers called nodes. A node is a server that keeps a copy of the blockchain (the shared ledger of transactions) and answers questions from other software. One way it answers questions is through an interface called JSON-RPC: a client sends a structured request, and the node sends back a structured reply. Think of it as a service counter where you hand over a form and get an answer back.
The feature involved is a call named get_output_distribution. A caller gives it a list of amounts and a starting height (a position in the blockchain). The researcher found that if you hand this call a very large list of amounts, the node crashes after roughly 90 seconds of being kept busy. The report says the problem probably affects all releases.
The reproduction is a single shell command. It first builds a long comma-separated list of numbers, then sends that list to the RPC endpoint:
values=`echo $(seq 0 500 900000)|sed -e 's/ /,/g'` ; curl http://[redacted]:38081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts": ['$values'], "from_height": 100, "cumulative": false}' -H 'Content-Type: application/json'
Line by line, this is what happens:
seq 0 500 900000prints the numbers 0, 500, 1000, and so on up to 900000, one per line. This is the raw material for the oversized list.sed -e 's/ /,/g'replaces the spaces between those numbers with commas, so the output becomes one long comma-separated string.values=stores that string in a shell variable calledvalues.curlis a command-line tool for sending HTTP requests, the same kind of request your browser sends when it loads a page. Here it sends a POST request tohttp://[redacted]:38081/json_rpc, which is the node's RPC address on the local machine.- The
-dpart is the request body: a JSON document asking for theget_output_distributionmethod, with the long list of amounts inserted into theamountsfield, afrom_heightof 100, andcumulativeset to false. -H 'Content-Type: application/json'tells the server that the body is JSON, so it knows how to read it.
The important part is the size of the amounts list. The researcher notes that if you reduce the 900000 number a little, the node does not crash but instead becomes a denial of service, taking about 90 seconds per call. That is a denial of service: the call becomes so slow that nobody else can realistically use it.
The report lists no supporting material, saying the attack is straightforward and compelling. It gives no fix, no bounty figure and no CVSS score. The platform records the severity as high and the weakness as uncontrolled resource consumption, and the report was disclosed on 20 August 2022.
In general, how this kind of bug works
Uncontrolled resource consumption is a family of bugs where a server accepts an input whose size or complexity it never caps, and the cost of handling that input grows with it. A useful comparison is a photocopy shop that charges per page but never limits how many pages you bring: one customer can keep the machine busy all day and everyone else waits.
Common shapes of this bug are:
- a list or array parameter with no maximum length;
- a number used directly as a loop count or as the size of an allocation;
- deeply nested structures that a parser expands recursively;
- regular expressions that backtrack badly on crafted strings.
The mechanism is simple: the attacker controls a multiplier, and the server multiplies. One request can then consume far more CPU, memory or time than the designer assumed. When the resource is shared across all clients, one request degrades service for everyone; when it is exhausted outright, the process or host fails. The bug class sits close to denial of service but is usually reported as its own weakness because the fix is an input limit rather than traffic control.
Defences are limits applied before the expensive work starts: maximum array lengths, maximum numeric values, request body size caps, timeouts and per-client rate limits. Rejecting oversized input early is cheaper and more reliable than trying to interrupt work already in progress.
How to test for it
Look for RPC, JSON and form endpoints that accept arrays, counts, ranges or free-form strings and pass them into loops, allocations, queries or parsers. Batch endpoints, search and filter parameters, pagination sizes, import features and anything that takes a list of identifiers are good candidates.
- Establish a baseline: send a normal, small request and note the response time and status.
- Increase one input at a time: grow the array length, the numeric value or the string length in steps, and record latency and response size at each step.
- Watch for non-linear growth: if doubling the input more than doubles the time or memory, the cost is uncontrolled.
- Push to the limit on a target you are authorised to test, and observe whether the service recovers, returns an error, or stops responding.
- Confirm the effect is attributable to your input by repeating with a small request afterwards.
A positive result is a measurable, repeatable jump in latency or resource use that scales with input size, ideally with the service recovering once you stop. Common false positives are ordinary slow queries on large datasets, caching effects that make the first request slow, network jitter, and shared infrastructure noise from other tenants. Repeat measurements and compare against a control request before reporting.
How it is fixed
The standard fix is to bound the input: cap the number of elements in list parameters, cap numeric values used as counts or ranges, and reject anything above the limit with a clear error before doing work. Request body size limits at the HTTP layer catch oversized payloads early. Server-side timeouts and memory limits contain the damage if a limit is missed. Rate limiting per client reduces the ease of repeated abuse but does not replace input validation. Where the expensive operation is unavoidable, moving it off the request path or chunking it keeps the service responsive.
Hunting notes
This bug class tends to hide in administrative and internal RPC interfaces, batch APIs, export and report generators, search backends, and any endpoint added for tooling rather than end users. Recon signals include JSON-RPC endpoints, parameters named like amounts, ids, heights, range, limit or count, and documentation that describes array inputs without stating a maximum.
To get a report accepted, show the smallest input that produces the effect, the measured difference against a baseline, and a clear statement of what an attacker gains: service unavailability for other users, a crashed process, or a call made unusable. Keep testing within the program's rules, avoid sustained attacks on production, and stop as soon as you have reproducible evidence.
Glossary
- Node: a server that keeps a copy of a blockchain and answers requests from other software.
- Blockchain: a shared, append-only ledger of transactions maintained by many computers.
- JSON-RPC: a way for programs to call functions on a remote server by sending a request in JSON format and receiving a JSON reply.
- JSON: a text format for structured data, made of keys and values, used widely for requests and responses.
- RPC: remote procedure call, a general term for asking a program on another machine to run a function for you.
- Endpoint: a specific address and path on a server that accepts requests, such as
/json_rpc. - Request: a message a client sends to a server asking it to do something.
- Response: the message a server sends back after handling a request.
- HTTP: the protocol browsers and tools use to exchange requests and responses over a network.
- POST request: an HTTP request that carries a body of data, often used to submit input to a server.
- Header: extra information attached to an HTTP request or response, such as the content type.
- Content-Type: a header that says what format the body is in, for example
application/json. - curl: a command-line tool for sending HTTP requests.
- Shell command: a line of text typed into a terminal to run a program or script.
- Variable: a named place in a shell script that stores a value for later use.
seq: a command that prints a sequence of numbers.sed: a command that edits text, often used to replace characters.- Parameter: a named input value in a request, such as
amountsorfrom_height. - Array: an ordered list of values, here the list of amounts.
- Height: the position of a block in the blockchain, counted from the first block.
- Output: in cryptocurrency terms, a record of funds that can later be spent.
- Crash: when a program stops running unexpectedly.
- Denial of service: making a service unusable for legitimate users, often by keeping it too busy to respond.
- Uncontrolled resource consumption: a weakness where a server accepts input whose size or complexity it does not limit, so handling it uses excessive CPU, memory or time.
- CPU: the processor that does a computer's computation; heavy work uses more of it.
- Memory: the working storage a program uses while running.
- Latency: the time between sending a request and receiving the response.
- Baseline: a normal measurement taken before testing, used for comparison.
- Rate limiting: restricting how many requests a client may make in a period of time.
- Timeout: a limit on how long an operation may run before it is stopped.
- Input validation: checking incoming data against rules, such as maximum size, before using it.
- CVSS: a standard scoring system for rating the severity of a vulnerability.
- Severity: a rating of how serious a vulnerability is, here recorded as high.