webauthn-open-source / fido2-lib

A node.js library for performing FIDO 2.0 / WebAuthn server functionality
https://webauthn.io
MIT License
394 stars 118 forks source link

Array.prototype methods cause validation error in the expected transports[<method>] to be 'string' #123

Open thirug010 opened 1 year ago

thirug010 commented 1 year ago

Issue: as the transports validation uses in to loop through items of array it bring the method defined array through prototype.

fix: use 'of' instead of 'in' ,because 'in' iterates over all enumerable property keys of an object * including the method cause invalid validation error, "of" only iterates through the values of objects.

thirug010 commented 1 year ago

Requested PR for this issue, Please review and merge it. ==> https://github.com/webauthn-open-source/fido2-lib/pull/125