Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS13aDJ3LTM5ZjQtcnB2Ms4AA_Dw

Hyperledger Indy's update process of a DID does not check who signs the request

Name

Updating a DID with a nym transaction will be written to the ledger if neither ROLE or VERKEY are being changed, regardless of sender.

Description

A malicious DID with no particular role can ask an update for another DID (but cannot modify its verkey or role). This is bad because:

  1. Any DID can write a nym transaction to the ledger (i.e., any DID can spam the ledger with nym transactions).
  2. Any DID can change any other DID's alias.
  3. The update transaction modifies the ledger metadata associated with a DID.

Expected vs Observed

We expect that if a DID (with no role) wants to update another DID (not its own or one it is the endorser), then the nodes should refuse the request. We can see that requirements in the Indy default auth_rules in Section "Who is the owner" in the last point of "Endorser using".

We observe that with a normal DID, we can update the field from for a random DID, for example, the one of a TRUSTEE. It creates then a new transaction on the ledger.

Explanation of the attack

We first begin to connect to the pool and open a wallet. Then, we will use a TRUSTEE (but can also be a STEWARD or an ENDORSER) DID V4SGRU86Z58d6TV7PBUe6f. We ask the information about V4SGRU86Z58d6TV7PBUe6f with a get-nym. We create a new DID V4SGRU86Z58d6TV7PBUe1a signed by V4SGRU86Z58d6TV7PBUe6f with no role. For the rest of the attack, we will use V4SGRU86Z58d6TV7PBUe1a to sign new transactions. We send a ledger nym did=V4SGRU86Z58d6TV7PBUe6f extra=hello to see if V4SGRU86Z58d6TV7PBUe1a can send an update of a TRUSTEE identity. When we ask information to the ledger about V4SGRU86Z58d6TV7PBUe6f, it answers that the from field is V4SGRU86Z58d6TV7PBUe1a (to compare with the first get-nym we did with from field = V4SGRU86Z58d6TV7PBUe6f). To see the log of the attack, I modified my indy-cli to print the json request and the json response directly on the terminal. You can find the log file indy.log in this archive.

Implementation notes

NymHandler method update_state, line 62. I think that we need to check if the DID which signs the transaction, owns the DID or is its endorser.

Steps to Reproduce

Environment

Ubuntu 18.04
Docker version 19.03.8
indy-cli
indy-ci Dockerfile is copied in this archive
To install indy-cli, run ./install_indy_cli.sh

Command

Here is the script to create the container, run the attack and remove the container and the image. Find below the command to execute each step separately.

./full_attack.sh

Installation of the environment

Install indy-cli and create an image with tag test from Dockerfile

./install.sh

Exploit

indy-cli proof_of_concept

Uninstallation of the environment

Suppress the container test and remove the image test

./uninstall.sh

Analysis

We are grateful to @alexandredeleze for discovering and responsibly disclosing the issue.

We were previously aware that any DID on the ledger can "update" the state (seqNo + txnTime) if it doesn't change the state data itself. We considered this a minor bug because only the seqNo and txnTime changed. But seeing that this can also affect the "parent" DID means that it has a higher severity.

Permalink: https://github.com/advisories/GHSA-wh2w-39f4-rpv2
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS13aDJ3LTM5ZjQtcnB2Ms4AA_Dw
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: 3 months ago
Updated: 3 months ago


CVSS Score: 7.5
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Identifiers: GHSA-wh2w-39f4-rpv2, CVE-2020-11093
References: Repository: https://github.com/hyperledger/indy-node
Blast Radius: 7.2

Affected Packages

pypi:indy-node
Dependent packages: 1
Dependent repositories: 9
Downloads: 12,992 last month
Affected Version Ranges: >= 0, < 1.12.4
Fixed in: 1.12.4
All affected versions: 0.0.2, 0.0.3, 0.0.4, 0.0.12, 0.0.20, 0.0.21, 0.0.22, 0.0.23, 0.0.24, 0.0.25, 0.0.28, 0.0.30, 0.0.31, 0.0.32, 0.4.27, 1.0.28, 1.0.29, 1.1.1, 1.1.30, 1.1.31, 1.1.32, 1.1.33, 1.1.34, 1.1.35, 1.1.36, 1.1.37, 1.1.38, 1.1.39, 1.1.40, 1.1.41, 1.1.42, 1.1.43, 1.2.44, 1.2.45, 1.2.46, 1.2.47, 1.2.48, 1.2.49, 1.2.50, 1.3.51, 1.3.52, 1.3.53, 1.3.54, 1.3.55, 1.3.56, 1.3.57, 1.3.58, 1.3.59, 1.3.60, 1.3.61, 1.3.62, 1.4.63, 1.4.64, 1.4.65, 1.4.66, 1.5.67, 1.5.68, 1.6.69, 1.6.70, 1.6.71, 1.6.72, 1.6.73, 1.6.74, 1.6.75, 1.6.76, 1.6.77, 1.6.78, 1.6.79, 1.6.80, 1.6.81, 1.6.82, 1.6.83, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.9.2, 1.10.0, 1.11.0, 1.12.0, 1.12.1, 1.12.2, 1.12.3
All unaffected versions: 1.12.4, 1.12.5, 1.12.6, 1.13.2