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
* @param {string|array} [secret] A string (or array of strings) representing cookie signing secret(s).
But cookie-signature allows not only string, but also ArrayBufferView(TypedArray, DataView), and crypto.KeyObject.
The secret is for an HMAC key, so technically we can allow string, ArrayBuffer, Buffer, TypedArray, DataView, KeyObject, and CryptoKey, which is described in the nodejs docs. And these types are represented as crypto.CipherKey type.
Currently, only string or string array types can be used as secret values.
cookie-parser/index.js
Line 33 in 429cfd4
But cookie-signature allows not only
string
, but alsoArrayBufferView
(TypedArray
,DataView
), andcrypto.KeyObject
.The secret is for an HMAC key, so technically we can allow
string
,ArrayBuffer
,Buffer
,TypedArray
,DataView
,KeyObject
, andCryptoKey
, which is described in the nodejs docs. And these types are represented ascrypto.CipherKey
type.This is also related to security concerns. See Using strings as inputs to cryptographic APIs
The text was updated successfully, but these errors were encountered: