Ecosyste.ms: Advisories

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

Security Advisories: GSA_kwCzR0hTQS0yZmY0LXhmcHItbTMycs4ABCjM

`Slip10Like` derivation method instantiated with certain curves may allow attacker to find derivation path which results into very long derivation (possible DoS)

Impact

Impacted are the only ones who use hd_wallet::Slip10Like or 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 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:

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

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:

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, 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

Credits

Thanks to Alessio Marziali [email protected] for discovering and flagging this issue

Permalink: https://github.com/advisories/GHSA-2ff4-xfpr-m32r
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS0yZmY0LXhmcHItbTMycs4ABCjM
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 10 days ago
Updated: 10 days ago


Identifiers: GHSA-2ff4-xfpr-m32r
References: Repository: https://github.com/LFDT-Lockness/hd-wallet
Blast Radius: 1.0

Affected Packages

cargo:slip-10
Dependent packages: 3
Dependent repositories: 0
Downloads: 13,467 total
Affected Version Ranges: <= 0.4.1
No known fixed version
All affected versions: 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.4.1
cargo:hd-wallet
Dependent packages: 0
Dependent repositories: 0
Downloads: 3,607 total
Affected Version Ranges: < 0.6.0
Fixed in: 0.6.0
All affected versions: 0.5.0, 0.5.1
All unaffected versions: 0.6.0