Information Exposure

Affecting pem package, versions <1.13.2

Do your applications use this vulnerable package? Test your applications

Overview

pem is a package to create private keys and certificates with node.js.

Affected versions of this package are vulnerable to Information Exposure. The package exposes sensitive data when the readPkcs12 is used.

The readPkcs12 function reads the certificate and key data from a pkcs12 file using the encryption password. As part of this process it creates a globally readable file with a filename of 20 random 0-f characters in the temporary directory containing the password which is then read by OpenSSL. The file containing the password is never cleaned up after it is used giving access to the pkcs12 password to any other users with access to read files from the system.

Remediation

Upgrade pem to version 1.13.2 or higher.

References

CVSS Score

7.5
high severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    None
  • Availability
    None
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Credit
The UK's National Cyber Security Centre (NCSC)
CWE
CWE-200
Snyk ID
SNYK-JS-PEM-173687
Disclosed
06 Nov, 2018
Published
13 Feb, 2019