MetaMask / key-tree

MIT License
49 stars 19 forks source link

deriveKeyFromPath should have some input validation #2

Closed rekmarks closed 3 years ago

rekmarks commented 3 years ago

deriveKeyFromPath takes a fullPath parameter without validating that the string is formatted correctly. We should do a RegEx pattern check to make sure that the path isn't obviously wrong.

Motivated by string splicing error here: https://github.com/MetaMask/metamask-snaps-beta/blob/f069030/app/scripts/controllers/permissions/restrictedMethods.js/#L159-L175

kumavis commented 3 years ago

nice, added