GHSA-2ff4-xfpr-m32r: Hd wallet Denial of Service Vulnerability

MODERATE
Published
Advisory Summary

GHSA-2ff4-xfpr-m32r is a MODERATE denial of service vulnerability (General Security Weakness) affecting Hd wallet libraries in the crates.io ecosystem. The issue involves `slip10like` derivation method instantiated with certain curves may allow attacker to find derivation path which results into very long derivation (possible dos). Remediation is available by upgrading affected packages to version 0.6.0.

GHSA-2ff4-xfpr-m32r at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-2ff4-xfpr-m32r
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Hd wallet
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-2ff4-xfpr-m32r

To remediate this vulnerability, upgrade all affected Hd wallet dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

hd-wallet fixed: 0.6.0
Upgrade hd-wallet to 0.6.0
slip-10 fixed: Latest secure release
Upgrade slip-10 to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for hd-wallet

How to Check if You Are Affected

To determine whether your application is affected by GHSA-2ff4-xfpr-m32r, inspect your project dependencies for Hd wallet:

inspect dependencies for hd-wallet

Analyze the terminal output to locate any version of Hd wallet in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Hd wallet, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact <!-- _What kind of vulnerability is it? Who is impacted?_ --> **Impacted are the only ones who use [`hd_wallet::Slip10Like`](https://docs.rs/hd-wallet/0.5.1/hd_wallet/struct.Slip10Like.html) or [`slip_10`](https://docs.rs/slip-10/latest/slip_10/) derivation method instantiated with curves other than secp256k1 and secp256r1.** `hd_wallet` crate used to provide `Slip10Like` derivation method, which is also provided in `slip-10` crate as a default derivation method. It's based on [slip10](https://github.com/satoshilabs/slips/blob/master/slip-0010.md) method that searches for a valid child key in an infinite loop until it's found. Theoretically, this could be exploited by an attacker by finding a derivation path that would force someone to execute a lot of iterations of this loop to find a valid child key. This attack, however, requires the probability of getting an invalid scalar from random 32 bytes to be high. Slip10 is protected from this attack as it's only defined on secp256k1 and secp256r1 curves, for which such probability is very low: - For secp256k1, probability is $< 2^{-127}$. This means that a loop with 2 or more iterations is vanishingly impossible. - For secp256r1, probability is $< 2^{-32}$. This means that a loop with 5 or more iterations is vanishingly impossible. While standard curves are safe to use with slip10, we used to allow slip10-like derivation which can be instantiated with any curve. For instance, one could instantiate it with ed25519 or stark curves, for which probability of getting invalid scalar from random 32 bytes is >90%, so theoretically, attacker could try to DoS such construction. ### Patches <!-- _Has the problem been patched? What versions should users upgrade to?_ --> `hd_wallet v0.6.0` has been patched by removing slip10-like derivation from public API. If you need HD derivation on other curves than secp256k1 and secp256r1, we suggest you to use: * [`hd_wallet::Edwards`](https://docs.rs/hd-wallet/latest/hd_wallet/edwards/struct.Edwards.html) derivation method available for ed25519 curve * [`hd_wallet::Stark`](https://docs.rs/hd-wallet/latest/hd_wallet/stark/struct.Stark.html) derivation method available for stark curve Both derivation methods are non-standard, but secure and efficient. **If you're still using `slip_10`** and would like to migrate to patched version, please migrate to `hd_wallet v0.6`. You may first migrate from `slip_10 v0.4` to `hd_wallet v0.5` by following migration instructions available [in the docs](https://docs.rs/slip-10/latest/slip_10/), and then upgrade from `hd_wallet v0.5` to `hd_wallet v0.6`. ### Workarounds Technically, you don't need to upgrade if you don't use slip10-like derivation instantiated with other curves than secp256k1 or secp256r1. However, if you do, migrating to other derivation method might be required. ### Reach out to us in Discord If you want to reach out to us, feel free to write to [`#lockness` room in Discord](https://discordapp.com/channels/905194001349627914/1294284489635139585) ### Credits Thanks to Alessio Marziali <alessio.marziali@metaco.com> for discovering and flagging this issue

GHSA-2ff4-xfpr-m32r Affected Hd wallet Versions

2 component(s)
Fixed Versions:
0.6.0
Product / Package Ecosystem Affected Versions Fixed Version
hd-wallet
crates.io
< 0.6.0
0.6.0
slip-10
crates.io
≤ 0.4.1

References

Frequently Asked Questions

What is GHSA-2ff4-xfpr-m32r?
GHSA-2ff4-xfpr-m32r is a security vulnerability in Hd wallet involving `Slip10Like` derivation method instantiated with certain curves may allow attacker to find derivation path which results into very long derivation (possible DoS) under General Security Weakness.
Which Hd wallet versions are affected?
Affected versions include releases prior to 0.6.0 across affected packages: hd-wallet, slip-10.
What version fixes GHSA-2ff4-xfpr-m32r?
Upgrading to 0.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hd-wallet affected?
Yes, hd-wallet is affected in releases prior to 0.6.0. Upgrade your dependency to 0.6.0 or later.
Is slip-10 affected?
Yes, slip-10 is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-2ff4-xfpr-m32r?
GHSA-2ff4-xfpr-m32r is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-2ff4-xfpr-m32r?
Run the dependency tree command: 'inspect dependencies for hd-wallet'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2ff4-xfpr-m32r",
  "modified" : "2024-12-18T15:51:24Z",
  "published" : "2024-12-18T15:51:24Z",
  "aliases" : [ ],
  "summary" : "`Slip10Like` derivation method instantiated with certain curves may allow attacker to find derivation path which results into very long derivation (possible DoS)",
  "details" : "### Impact\n<!-- _What kind of vulnerability is it? Who is impacted?_ -->\n\n**Impacted are the only ones who use [`hd_wallet::Slip10Like`](https://docs.rs/hd-wallet/0.5.1/hd_wallet/struct.Slip10Like.html) or [`slip_10`](https://docs.rs/slip-10/latest/slip_10/) derivation method instantiated with curves other than secp256k1 and secp256r1.**\n\n`hd_wallet` crate used to provide `Slip10Like` derivation method, which is also provided in `slip-10` crate as a default derivation method. It's based on [slip10](https://github.com/satoshilabs/slips/blob/master/slip-0010.md) method that searches for a valid child key in an infinite loop until it's found.\n\nTheoretically, this could be exploited by an attacker by finding a derivation path that would force someone to execute a lot of iterations of this loop to find a valid child key. This attack, however, requires the probability of getting an invalid scalar from random 32 bytes to be high. Slip10 is protected from this attack as it's only defined on secp256k1 and secp256r1 curves, for which such probability is very low:\n\n- For secp256k1, probability is $< 2^{-127}$. This means that a loop with 2 or more iterations is vanishingly impossible.\n- For secp256r1, probability is $< 2^{-32}$. This means that a loop with 5 or more iterations is vanishingly impossible.\n\nWhile standard curves are safe to use with slip10, we used to allow slip10-like derivation which can be instantiated with any curve. For instance, one could instantiate it with ed25519 or stark curves, for which probability of getting invalid scalar from random 32 bytes is >90%, so theoretically, attacker could try to DoS such construction.\n\n### Patches\n<!-- _Has the problem been patched? What versions should users upgrade to?_ -->\n\n`hd_wallet v0.6.0` has been patched by removing slip10-like derivation from public API.\n\nIf you need HD derivation on other curves than secp256k1 and secp256r1, we suggest you to use:\n* [`hd_wallet::Edwards`](https://docs.rs/hd-wallet/latest/hd_wallet/edwards/struct.Edwards.html) derivation method available for ed25519 curve\n* [`hd_wallet::Stark`](https://docs.rs/hd-wallet/latest/hd_wallet/stark/struct.Stark.html) derivation method available for stark curve\n\nBoth derivation methods are non-standard, but secure and efficient.\n\n**If you're still using `slip_10`** and would like to migrate to patched version, please migrate to `hd_wallet v0.6`. You may first migrate from `slip_10 v0.4` to `hd_wallet v0.5` by following migration instructions available [in the docs](https://docs.rs/slip-10/latest/slip_10/), and then upgrade from `hd_wallet v0.5` to `hd_wallet v0.6`.\n\n### Workarounds\nTechnically, you don't need to upgrade if you don't use slip10-like derivation instantiated with other curves than secp256k1 or secp256r1.\n\nHowever, if you do, migrating to other derivation method might be required.\n\n### Reach out to us in Discord\n\nIf you want to reach out to us, feel free to write to [`#lockness` room in Discord](https://discordapp.com/channels/905194001349627914/1294284489635139585)\n\n### Credits\n\nThanks to Alessio Marziali <alessio.marziali@metaco.com> for discovering and flagging this issue",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "hd-wallet"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "slip-10"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.4.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/LFDT-Lockness/hd-wallet/security/advisories/GHSA-2ff4-xfpr-m32r"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/LFDT-Lockness/hd-wallet/commit/a7e37704600ee7c737dbb02db08814dd2d15389d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/LFDT-Lockness/hd-wallet"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-18T15:51:24Z",
    "nvd_published_at" : null
  }
}