Grant uses jwk-to-pem that has a dependency to elliptic which itself has a vulnerability but seems to be abandoned.
jwk_to_pem can be replaced completely by two functions which are part of the Node.js crypto module: createPublicKey and createPrivateKey.
In the case of grant it's sufficient to replace
var pem = require('jwk-to-pem');
return pem(jwk, { private: true });
in oidc.js (lines 29,30) with
return crypto.createPrivateKey({
key: jwk,
format: "jwk"
}).export({
type: "pkcs8",
format: "pem"
});
and to remove the jwk-to-pem dependency from package.json. See also Brightspace/node-jwk-to-pem#193.
Grant uses jwk-to-pem that has a dependency to elliptic which itself has a vulnerability but seems to be abandoned.
jwk_to_pemcan be replaced completely by two functions which are part of the Node.jscryptomodule: createPublicKey and createPrivateKey.In the case of
grantit's sufficient to replacein
oidc.js(lines 29,30) withand to remove the
jwk-to-pemdependency frompackage.json. See also Brightspace/node-jwk-to-pem#193.