Skip to content

[Toolkit] Issue AN: Incorrect Derivation Path Role #1327

@m2ux

Description

@m2ux

Summary

Wallet constructors allow a DerivationPath with an incorrect role for the wallet type (e.g., a shielded role in a DustWallet), which could silently derive keys under the wrong path.

Addresses Least Authority audit Issue AN (Low severity).

Problem

  • DustWallet::from_path() accepts any DerivationPath regardless of role
  • ShieldedWallet::from_path() accepts any DerivationPath regardless of role
  • A DustWallet constructed with a shielded role derives keys under the shielded path (m/44'/2400'/0'/3/0 instead of m/44'/2400'/0'/2/0)
  • Mismatched derivation silently produces keys that won't match expected wallet operations

Expected Behavior

  • DustWallet::from_path() rejects derivation paths with non-Role::Dust roles
  • ShieldedWallet::from_path() rejects derivation paths with non-Role::Zswap roles
  • Mismatched role construction panics with a descriptive message

References

  • Least Authority — Shielded Midnight Network Node Initial Audit Report (October 24, 2025), Issue AN, pp. 55–56
  • JIRA: https://shielded.atlassian.net/browse/PM-20015
  • Parent epic: PM-19974 (Q4 2025 Least Authority 'Node' Audit Findings)

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditAudit-related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions