You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(key-wallet): refuse BIP-32 depth past 255 instead of overflowing #1298
ExtendedPrivKey::ckd_priv and ExtendedPubKey::ckd_pub compute the child depth as self.depth + 1 on a u8 (key-wallet/src/bip32.rs). The same pattern is in derivation_bls_bip32.rs and derivation_slip10.rs.
DerivationPath::from_str accepts paths with more than 255 components, so deriving m followed by 256 /0 steps panics in builds with overflow checks. Without overflow checks, the depth wraps to 0 and a serialized xpub carries the wrong depth.
Found in review of dashpay/platform#5727, whose helpers derive at caller-supplied path strings.
Proposed fix: use checked_add and return a typed depth-overflow error from child derivation (or reject paths deeper than 255 when parsing), and test depths 255 and 256.
Activity