Last tested: 20 Feb, 2018

nodemailer vulnerabilities

Easy as cake e-mail sending from your Node.js applications

View on npm

nodemailer (latest)

Published 19 Feb, 2018

Known vulnerabilities0
Vulnerable paths0
Dependencies0

No known vulnerabilities in nodemailer

Security wise, nodemailer seems to be a safe package to use.
Over time, new vulnerabilities may be disclosed on nodemailer and other packages. To easily find, fix and prevent such vulnerabilties, protect your repos with Snyk!

Vulnerable versions of nodemailer

Fixed in 2.3.2

Uninitialized Memory Exposure

medium severity
  • Vulnerable module: ip
  • Introduced through: socks@1.1.8

Detailed paths

  • Introduced through: nodemailer@2.3.1-rc.0 > socks@1.1.8 > ip@0.3.3

Overview

ip is an IP address utility for node.js Affected versions of the package are vulnerable to Uninitialized Memory Exposure due to an insecure use of the Node.js Buffer class.

Details

The Buffer class in Node.js is a mutable array of binary data, and can be initialized with a string, array or number.

const buf1 = new Buffer([1,2,3]);
// creates a buffer containing [01, 02, 03]
const buf2 = new Buffer('test');
// creates a buffer containing ASCII bytes [74, 65, 73, 74]
const buf3 = new Buffer(10);
// creates a buffer of length 10

The first two variants simply create a binary representation of the value it received. The last one, however, pre-allocates a buffer of the specified size, making it a useful buffer, especially when reading data from a stream. When using the number constructor of Buffer, it will allocate the memory, but will not fill it with zeros. Instead, the allocated buffer will hold whatever was in memory at the time. If the buffer is not zeroed by using buf.fill(0), it may leak sensitive information like keys, source code, and system info.

For more information on the Buffer vulnerability, go to our blog.

Remediation

Upgrade ip to version 1.1.5 or higher.

References

Fixed in 1.0.0

Regular Expression Denial of Service (ReDoS)

low severity

Detailed paths

  • Introduced through: bower@0.7.1 > request@2.11.4 > mime@1.2.11
  • Introduced through: bower@0.7.1 > request@2.11.4 > form-data@0.0.10 > mime@1.2.11
  • Introduced through: nodemailer@0.7.1 > mailcomposer@0.2.12 > mime@1.2.11

Overview

mime is a comprehensive, compact MIME type module.

Affected versions of this package are vulnerable to Regular expression Denial of Service (ReDoS). It uses regex the following regex /.*[\.\/\\]/ in its lookup, which can cause a slowdown of 2 seconds for 50k characters.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Many Regular Expression implementations may reach extreme situations that cause them to work very slowly (exponentially related to input size), allowing an attacker to exploit this and can cause the program to enter these extreme situations by using a specially crafted input and cause the service to excessively consume CPU, resulting in a Denial of Service.

You can read more about Regular Expression Denial of Service (ReDoS) on our blog.

Remediation

Upgrade mime to versions 1.4.1, 2.0.3 or higher.

References