Information Exposure Affecting pem package, versions <1.13.2


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-PEM-173687
  • published 13 Feb 2019
  • disclosed 6 Nov 2018
  • credit The UK's National Cyber Security Centre (NCSC)

Introduced: 6 Nov 2018

CVE NOT AVAILABLE CWE-200 Open this link in a new tab

How to fix?

Upgrade pem to version 1.13.2 or higher.

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.

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
7.5 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    None
  • Availability (A)
    None