mscdex / node-imap

An IMAP client module for node.js.
MIT License
2.14k stars 379 forks source link

Switch to safe-utf 7 to avoid vulnerability notifications #911

Open alisonaquinas opened 8 months ago

alisonaquinas commented 8 months ago

I've been working with this library recently for a personal project, and I'm hugely grateful for the work that's gone into it! The problem I ran into is that semver, a dependency of utf7 has a known vulnerability:

$ npm audit
# npm audit report

semver  <5.7.2
Severity: moderate
semver vulnerable to Regular Expression Denial of Service - https://github.com/advisories/GHSA-c2qf-rxjj-qqgw
fix available via `npm audit fix --force`
Will install utf7@1.0.1, which is a breaking change
node_modules/semver
  utf7  >=1.0.2
  Depends on vulnerable versions of semver
  node_modules/utf7

2 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Unfortunately, Konstantin, who created the utf7 library, never published the code on a public repository where a Pull request could be submitted. I've reached out to him directly, but in the meantime, I introduced https://github.com/alisonaquinas/node-safe-utf7 to resolve the issue.

alisonaquinas commented 8 months ago

got back to me and pointed me to https://github.com/kkaefer/utf7/, I've posted https://github.com/kkaefer/utf7/pull/15

alisonaquinas commented 7 months ago

I've not heard back from Konstantin despite my best efforts. He's not been merging PRs at all, given the state of other PRs and issues. My latest version removes the need for semver completely.