Amulet Security Advisory for Cosmovisor: ASA-2023-001

Component: Cosmovisor

Criticality: Medium

Affected Versions: Cosmovisor < v1.0.0 (distributed with Cosmos-SDK < 0.46)

Affected Users: Validator and Node operators utilizing unsupported versions of Cosmovisor

Impact: DOS, potential RCE on node depending on configuration

An issue has been identified on unsupported versions of Cosmovisor which may result in a Denial of Service or Remote Code Execution path depending on configuration for a node or validator using the vulnerable version to manage their node.

If a validator is utilizing an affected version of Cosmovisor with DAEMON_ALLOW_DOWNLOAD_BINARIES set to true, a non-default configuration, it may be possible for an attacker to trigger a Remote Code Execution path as well on the host. In this configuration it is recommended to immediately stop use of the DAEMON_ALLOW_DOWNLOAD_BINARIES feature, and then proceed with an upgrade of Cosmovisor.

It is recommended that all validators utilizing unsupported versions of Cosmovisor to upgrade to the latest supported versions immediately. If you are utilizing a forked version of Cosmos-SDK, it is recommended to stop use of Cosmovisor until it is possible to update to a supported version of Cosmovisor, whether through your project’s fork, or directly compiled from the Cosmos-SDK. At the time of this advisory, the latest version of Cosmovisor is v1.5.0.

Additionally, the Amulet team recommends that developers building chains powered by Cosmos-SDK share this advisory with validators and node operators to ensure this information is available to all impacted parties within their ecosystems.

A Github Security Advisory for this issue is available in the Cosmos-SDK repository. For more information about Cosmovisor, see Cosmovisor | Cosmos SDK.

This issue was discovered by Maxwell Dulin and Nathan Kirkland, who reported it to the Cosmos Bug Bounty Program. If you believe you have found a bug in the Interchain Stack or would like to contribute to the program by reporting a bug, please see HackerOne.

How to tell if I am affected?

Running the following command will output whether your cosmovisor version is vulnerable to this issue or not.

Vulnerable to this issue:

strings ./cosmovisor | grep -q "NEEDED at" && echo "vulnerable" || echo "NOT vulnerable"

vulnerable

NOT vulnerable to this issue:

strings ./cosmovisor_new | grep -q "NEEDED at" && echo "vulnerable" || echo "NOT vulnerable"

NOT vulnerable

Note from Amulet on the Security Advisory Process

In the interest of timely resolution of this issue for validators and node operators, the Amulet team has chosen to use existing processes and resources for distributing security advisories within the Cosmos and Interchain Ecosystems. Stay tuned as we implement an improved, more robust security advisory distribution system that will provide equitable access to information about security issues in the Interchain Stack.

5 Likes

Thank you @Jessysaurusrex very much.

This is absolutely an improvement already, and I’m excited to see what comes next.

Also many thanks to Mr. Backwards K. It is very exciting to see external security practitioners working on things in cosmos.

1 Like

Thank you! If you happen to know of any validators who heavily rely on Cosmovisor for unattended upgrades, it would be immensely helpful to spread the word and to encourage them (and other node operators) double check on what version of the utility they are using as part of their node operations.

1 Like

This issue was already documented.
That was one of the reasons we released Cosmovisor v1.0.0 and migrated to a new Cosmosvisor design.
That being said, it should be stated that Cosmovisor <v1.0 should not be used.

@Jessysaurusrex

Thanks for point it.
In first place I would change the command to this one to ensure that we are calling the proper binary:

strings $(which cosmovisor) | grep -q "NEEDED at" && echo "vulnerable" || echo "NOT vulnerable"

People who find it vulnerable should check also the service file to verify the binary path.

By other hand, as complement of your info, we provide here a detailed guide about how to implement (securely) Cosmovisor:

1 Like

If someone is running < v1.0.0 is very very very outdated and says a lot of him :laughing:

2 Likes

Yeah I didn’t really read the version numbers correctly.

This is a lot less of a find than I thought it was

And it’s definitely been reported

I guess the only plus side here is that I do think it’s really good to have these issues out front and center on the forum here

Hi, i have one question: is it possible to run cosmovisor < v1.0.0 for blockchain with cosmos sdk > v0.46.0? I’m unable to find anywhere information about cosmovisor versioning and compatibility with cosmos sdk.

Thanks in advance :slight_smile:

Anecdotally, I am aware of validators running the latest version of Cosmovisor with chains that are still running earlier versions of the SDK than the latest… and validators running old versions of Cosmovisor with later versions of the SDK. So yes, it should be possible to run a newer version of Cosmovisor with an earlier version of the SDK without compatibility issues.

I would recommend testing this out first before committing to it in a mainnet environment, of course.

Re: documenting versioning, I will pass on the feedback and see if there’s a resource that exists, or if there’s room for improvement here.

IIRC, Cosmovisor <1.0 is not compatible with Cosmos SDK v046+ for automatic updates. Cosmovisor v1+ expects a file with plan info, that is produced by app with cosmos sdk v046+

2 Likes