Skip to content
RCE Disclosed report Advanced

RCE and DoS in Cosmovisor

An old version of Cosmovisor contained a flaw that could be triggered through printed output, leading to a denial of service or potentially remote code execution depending on how the host was configured. The researcher states the issue may still affect otherwise updated nodes on Cosmos chains.

strikeout Follow

Originally disclosed on HackerOne

  • Triaged in 12 days
  • Fixed in 47 days
  • Paid in 47 days
  • Disclosed after 2 months

Summary by the program

A bug in early versions of cosmovisor that could lead to DOS or potential RCE depending on the host configuration was discovered.

Summary by the researcher

Really bad vulnerability in old version of cosmos-sdk can lead to RCE at worst, DoS at best, and could still be active even in otherwise updated nodes on cosmos chains.

We would like to get a security advisory out there in order to ensure that users are not running a vulnerable version of the Cosmovisor. We found a print sink that works on all chains we've tested to trigger this issue. We felt this was the best means of communicating with the developing in a private channel about the exploitability of this bug.

For more on the vulnerability, read about the bug at https://maxwelldulin.com/BlogPost/stdout-cosmos-sdk-rce.

The original report as published on HackerOne, by strikeout. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 4 min read.

What the report shows

The component at issue is Cosmovisor, part of the Cosmos SDK. The report concerns early versions of Cosmovisor. The program's summary states that a bug in those early versions could lead to denial of service, or potentially remote code execution depending on the host configuration.

The researcher describes it as a serious vulnerability in an old version of cosmos-sdk that can lead to RCE at worst and DoS at best, and notes that it could still be active even on otherwise updated nodes on Cosmos chains. The stated goal was to get a security advisory published so that users would not keep running a vulnerable version of Cosmovisor.

The researcher reports having found a print sink that works on all chains they tested to trigger the issue, and says this was felt to be the best means of communicating with the developers in a private channel about exploitability. The report itself does not include the payload, the affected version numbers, the host configuration that turns DoS into RCE, or the chains tested. For the technical detail it points to an external write-up at https://maxwelldulin.com/BlogPost/stdout-cosmos-sdk-rce.

No bounty amount or CVSS score is given, and the report text does not describe a fix.

Root cause

The report does not analyse the defect. The report does not analyse the defect or name the code path involved. The dependence on host configuration, mentioned in the program summary, suggests the outcome varies with how the node and its supervisor are set up. The report does not name the code path involved.

Impact

The report keeps its claims hedged. At worst the bug allows remote code execution; at best it causes denial of service. The researcher notes the bug could still be active even on otherwise updated nodes on Cosmos chains. The exact preconditions for the RCE outcome are not stated in the report.

How this kind of bug works

Code injection through program output belongs to a broader class in which data crosses a trust boundary and is treated as instructions. A process writes a line to standard output or standard error; a supervisor, log shipper, shell wrapper or terminal layer reads that line and acts on it. If the reader interprets the data as a command, a format string, a path or a configuration directive, the writer controls behaviour in the reader's context.

Typical mechanisms include passing captured output to a shell without quoting, using it as a format string, writing it into a file that is later sourced or executed, or letting it select which binary or argument list is run. The bug class persists because output is usually assumed to be benign, and because the writer and the reader often run with different privileges. Defences are the usual ones for injection: never treat data as code, pass arguments as arrays rather than shell strings, use fixed format strings, validate and encode output before it reaches an interpreter, and run supervisors with the least privilege they need.

How to test for it

  1. Map the data flow. Identify components that capture another process's output: supervisors, wrappers, init scripts, log processors, health checkers, upgrade handlers. Note which of them later execute, source or parse that output.
  2. Establish a controlled writer. Find an input that reaches the printed output of the supervised process: a log line, an error message, a configuration value echoed at startup, a filename included in a message.
  3. Send a benign marker first. Use a distinctive string and confirm it appears verbatim in the place where the reader consumes it. This proves the sink exists before you try to influence it.
  4. Escalate carefully. Introduce characters that are meaningful to the suspected interpreter (shell metacharacters, format specifiers, newlines, path separators) and observe whether the reader's behaviour changes: an extra command runs, a format directive is expanded, a file is written or read unexpectedly.
  5. Record the environment. Note the version, the host configuration and the privileges of both the writer and the reader, since the same input may be harmless in one setup and dangerous in another.

A positive result is a marker that changes the reader's behaviour in a way you can reproduce, ideally with a harmless action such as creating a file or printing a second marker. Common false positives are output that is merely logged and never interpreted, escaping that silently neutralises your characters, and behaviour that depends on a configuration you changed yourself rather than on the attacker-controlled input.

How it is fixed

Standard fixes are to stop interpreting captured output: invoke subprocesses with argument arrays instead of shell strings, use constant format strings, and treat every line from a child process as opaque data. Where output must be parsed, apply strict validation and allow-listing. Supervisors should run with minimal privileges so that a successful injection has less to work with, and affected versions should be replaced, with an advisory telling users which versions are safe.

Hunting notes

This class tends to hide at the seams between components: process supervisors, upgrade and restart logic, log pipelines, backup scripts and anything that shells out. Recon signals include wrappers that build command strings from variables, configuration files that are generated from runtime data, and components that mix privileged and unprivileged execution. To make a report accepted, show the full path from an input an attacker can influence to the sink, demonstrate the effect with a harmless payload, state the version and configuration precisely, and be explicit about which outcome (disruption or execution) you actually achieved rather than the worst case you suspect.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 7 min read.

What happened, in plain words

This report is about a bug in Cosmovisor, part of the Cosmos SDK, a set of software tools used to build and run blockchain networks (Cosmos chains).

To understand the bug you first need to know what Cosmovisor does. A blockchain node is a program that keeps a copy of the chain and talks to other nodes. From time to time the chain needs a software upgrade. Cosmovisor is the process supervisor for the node program. Think of it as a building manager who starts the machinery in the basement, watches it, and swaps in a new machine when the schedule says so.

The problem, as the program's summary puts it, is that a bug in early versions of Cosmovisor could lead to denial of service (DoS: the node stops working, so the service is unavailable) or potentially remote code execution (RCE: an attacker gets their own instructions run on the machine), depending on how the host is configured. The researcher calls it a really bad vulnerability in an old version of cosmos-sdk, RCE at worst and DoS at best, and warns that it could still be active even on otherwise updated nodes on Cosmos chains. That last point matters: a node operator may have updated the main node software and still be running an old, vulnerable Cosmovisor underneath it.

The stated goal of the report was to get a security advisory published, so that users would stop running a vulnerable version of Cosmovisor. The researcher says they found a print sink that works on all chains they tested to trigger the issue. A print sink is a place where something that gets printed (written to the screen or to a log) is later treated as an instruction rather than as plain text. The researcher felt this was the best way to talk to the developers privately about how exploitable the bug is.

The report itself is short. It does not include the payload, the affected version numbers, the host configuration that turns DoS into RCE, or the chains that were tested. For the technical detail it points to an external write-up at https://maxwelldulin.com/BlogPost/stdout-cosmos-sdk-rce. It also does not describe a fix.

Root cause

The report does not analyse the defect in detail. The report does not analyse the defect in detail or name the code path involved. That is why the researcher calls the trigger a print sink: printed data reaches a place that can execute or disrupt something. The program summary's mention of host configuration suggests the outcome depends on how the node and its supervisor are set up. The report does not name the code path involved.

Impact

The claims are deliberately hedged. At worst the bug allows remote code execution; at best it causes denial of service. The researcher warns that the bug could still be active even on otherwise updated nodes on Cosmos chains. The exact conditions needed for the RCE outcome are not stated.

In general, how this kind of bug works

Code injection through program output belongs to a wider family of bugs in which data crosses a trust boundary and is then treated as instructions. A process writes a line to its standard output or standard error (the two streams where a program sends its normal messages and its error messages). A supervisor, log shipper, shell wrapper or terminal layer reads that line and acts on it. If the reader interprets the data as a command, a format string, a file path or a configuration directive, then whoever controls the writer controls behaviour in the reader's context.

A useful everyday comparison is a mailroom. If a clerk reads the address on a parcel and simply follows it, that is fine. If the clerk reads a note inside the parcel that says "deliver all future parcels to this other address" and obeys it, then anyone who can post a parcel can redirect the mail. Output from a child process is normally assumed to be harmless, which is exactly why this class of bug keeps appearing, and the writer and the reader often run with different privileges, which is what makes it dangerous.

Typical mechanisms include passing captured output to a shell without quoting, using it as a format string, writing it into a file that is later sourced or executed, or letting it choose which binary or argument list is run. The defences are the usual ones for injection: never treat data as code, pass arguments as arrays rather than shell strings, use fixed format strings, validate and encode output before it reaches an interpreter, and run supervisors with the least privilege they need.

In general, how to test for it

  1. Map the data flow. Identify components that capture another process's output: supervisors, wrappers, init scripts, log processors, health checkers, upgrade handlers. Note which of them later execute, source or parse that output.
  2. Establish a controlled writer. Find an input that reaches the printed output of the supervised process: a log line, an error message, a configuration value echoed at startup, a filename included in a message.
  3. Send a benign marker first. Use a distinctive string and confirm it appears verbatim where the reader consumes it. This proves the sink exists before you try to influence it.
  4. Escalate carefully. Introduce characters that are meaningful to the suspected interpreter (shell metacharacters, format specifiers, newlines, path separators) and observe whether the reader's behaviour changes: an extra command runs, a format directive is expanded, a file is written or read unexpectedly.
  5. Record the environment. Note the version, the host configuration and the privileges of both the writer and the reader, since the same input may be harmless in one setup and dangerous in another.

A positive result is a marker that changes the reader's behaviour in a way you can reproduce, ideally with a harmless action such as creating a file or printing a second marker. Common false positives are output that is merely logged and never interpreted, escaping that silently neutralises your characters, and behaviour that depends on a configuration you changed yourself rather than on the attacker-controlled input.

In general, how it is fixed

Standard fixes are to stop interpreting captured output: invoke subprocesses with argument arrays instead of shell strings, use constant format strings, and treat every line from a child process as opaque data. Where output must be parsed, apply strict validation and allow-listing. Supervisors should run with minimal privileges so that a successful injection has less to work with, and affected versions should be replaced, with an advisory telling users which versions are safe.

In general, hunting notes

This class tends to hide at the seams between components: process supervisors, upgrade and restart logic, log pipelines, backup scripts and anything that shells out. Recon signals include wrappers that build command strings from variables, configuration files that are generated from runtime data, and components that mix privileged and unprivileged execution. To make a report accepted, show the full path from an input an attacker can influence to the sink, demonstrate the effect with a harmless payload, state the version and configuration precisely, and be explicit about which outcome (disruption or execution) you actually achieved rather than the worst case you suspect.

Glossary

  • Cosmos SDK: a framework of software tools for building and running blockchain networks.
  • Cosmovisor: a process supervisor that starts a Cosmos chain's node program and swaps in new versions during upgrades.
  • Node: a computer running the blockchain software that keeps a copy of the chain and communicates with other nodes.
  • Process supervisor: a program that starts, watches and restarts another program.
  • Denial of service (DoS): making a service unavailable, for example by crashing or stopping it.
  • Remote code execution (RCE): an attacker getting their own instructions executed on someone else's machine.
  • Code injection: a bug where data supplied by one party is treated as instructions by another.
  • Print sink: a place where printed output is later interpreted or acted upon rather than treated as plain text.
  • Payload: the specific input an attacker sends to trigger a bug.
  • Host configuration: the way a particular machine and its software are set up, which can change whether a bug is harmless or dangerous.
  • Standard output / standard error: the two streams a program uses for normal messages and error messages.
  • Format string: a template that tells a program how to turn values into text; if attacker data is used as the template, it can change behaviour.
  • Shell metacharacters: characters such as quotes, semicolons or pipes that a command shell treats as instructions.
  • Least privilege: running a program with only the permissions it actually needs.
  • False positive: a result that looks like a bug but is not, for example output that is only logged and never interpreted.
  • Security advisory: a public notice telling users that a vulnerability exists and which versions are safe.
  • CVSS: a standard scoring system for rating the severity of vulnerabilities.

More by strikeout

View all

1 more disclosed report, best first.

More from Cosmos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.