ericvicenti / ssh-keygen

Generates SSH key-pairs in node.js
MIT License
67 stars 49 forks source link

Outdated underscore dependency reported with High security #24

Closed jaspenlind closed 1 year ago

jaspenlind commented 3 years ago

=== npm audit security report ===

Some vulnerabilities require your attention to resolve Visit https://go.npm.me/audit-guide for additional guidance

High Arbitrary Code Execution Package: underscore atched in: >=1.12.1 Dependency of: ssh-keygen Path: ssh-keygen > underscore More info: https://npmjs.com/advisories/1674

micalevisk commented 2 years ago

as this repo feels abandoned, I've forked and published it under @micalevisk/ssh-keygen package. It doesn't rely on underscore anymore. And it has a type definitions file :fire:

import keygen from '@micalevisk/ssh-keygen'

keygen({
  comment: 'john@doe.com',
  read: true
}, function (err, out) { // Optional callback. Will return a Promise if not provided
  if (err !== undefined) return console.log('There was a problem : ' + err)
  console.log('Done generating key pairs')
  console.log(out?.key)
  console.log(out?.pubKey)
})
![image](https://user-images.githubusercontent.com/13461315/151904001-ca89cbfb-0caa-4482-9861-e79208944a90.png) ![image](https://user-images.githubusercontent.com/13461315/151904012-2c9c248e-0925-4453-8789-37ec7d286e05.png)

Also, I'm planning to do the following (later):

(I'll update this message accordingly).

ericvicenti commented 1 year ago

Apologies for the late response and "High security" warning. There is no security impact here as we don't use underscore's template function.

And wow, I must have been 10 years dumber when I wrote this library, because it literally imports underscore for _.isUndefined, LOL