Skip to content

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

High severity GitHub Reviewed Published Dec 22, 2020 in hyperledger/indy-node • Updated Aug 30, 2024

Package

pip indy-node (pip)

Affected versions

>= 0, < 1.12.4

Patched versions

1.12.4

Description

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.

References

@esplinr esplinr published to hyperledger/indy-node Dec 22, 2020
Published by the National Vulnerability Database Dec 24, 2020
Published to the GitHub Advisory Database Aug 30, 2024
Reviewed Aug 30, 2024
Last updated Aug 30, 2024

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v4 base metrics

Exploitability Metrics
Attack Vector Network
Attack Complexity Low
Attack Requirements None
Privileges Required None
User interaction None
Vulnerable System Impact Metrics
Confidentiality None
Integrity High
Availability None
Subsequent System Impact Metrics
Confidentiality None
Integrity None
Availability None

CVSS v4 base metrics

Exploitability Metrics
Attack Vector: This metric reflects the context by which vulnerability exploitation is possible. This metric value (and consequently the resulting severity) will be larger the more remote (logically, and physically) an attacker can be in order to exploit the vulnerable system. The assumption is that the number of potential attackers for a vulnerability that could be exploited from across a network is larger than the number of potential attackers that could exploit a vulnerability requiring physical access to a device, and therefore warrants a greater severity.
Attack Complexity: This metric captures measurable actions that must be taken by the attacker to actively evade or circumvent existing built-in security-enhancing conditions in order to obtain a working exploit. These are conditions whose primary purpose is to increase security and/or increase exploit engineering complexity. A vulnerability exploitable without a target-specific variable has a lower complexity than a vulnerability that would require non-trivial customization. This metric is meant to capture security mechanisms utilized by the vulnerable system.
Attack Requirements: This metric captures the prerequisite deployment and execution conditions or variables of the vulnerable system that enable the attack. These differ from security-enhancing techniques/technologies (ref Attack Complexity) as the primary purpose of these conditions is not to explicitly mitigate attacks, but rather, emerge naturally as a consequence of the deployment and execution of the vulnerable system.
Privileges Required: This metric describes the level of privileges an attacker must possess prior to successfully exploiting the vulnerability. The method by which the attacker obtains privileged credentials prior to the attack (e.g., free trial accounts), is outside the scope of this metric. Generally, self-service provisioned accounts do not constitute a privilege requirement if the attacker can grant themselves privileges as part of the attack.
User interaction: This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable system. This metric determines whether the vulnerability can be exploited solely at the will of the attacker, or whether a separate user (or user-initiated process) must participate in some manner.
Vulnerable System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the VULNERABLE SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the VULNERABLE SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the VULNERABLE SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
Subsequent System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the SUBSEQUENT SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the SUBSEQUENT SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the SUBSEQUENT SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

EPSS score

0.178%
(55th percentile)

Weaknesses

CVE ID

CVE-2020-11093

GHSA ID

GHSA-wh2w-39f4-rpv2

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.