Vulnerabilities in pkg:npm/pem

PACKAGE
Advisory Summary

GHSA-pgcr-7wm4-mcv6 is a CRITICAL (CVSS 7.5) sensitive data exposure vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Pem libraries in the npm ecosystem. The issue involves sensitive data exposure in pem. Remediation is available by upgrading affected packages to version 1.13.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/pem

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/pem. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-pgcr-7wm4-mcv6 - CRITICAL Sensitive Data Exposure in pem

GHSA-pgcr-7wm4-mcv6 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-pgcr-7wm4-mcv6
Severity CRITICAL
CVSS v3.1 Base Score 7.5
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Pem
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-pgcr-7wm4-mcv6

To remediate this vulnerability, upgrade all affected Pem dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pem fixed: 1.13.2
npm install pem@1.13.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls pem

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-pgcr-7wm4-mcv6, inspect your project dependencies using npm:

npm ls pem

Analyze the terminal output to locate any version of Pem in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.13.2), your application is affected.

Note: The npm ls pem command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Pem, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Versions of `pem` before 1.13.2 expose 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. ## Recommendation Update to version 1.13.2 or later.

GHSA-pgcr-7wm4-mcv6 Affected Pem Versions

1 component(s)
Fixed Versions:
1.13.2
Product / Package Ecosystem Affected Versions Fixed Version
pem
npm
< 1.13.2
1.13.2

References

Frequently Asked Questions

What is GHSA-pgcr-7wm4-mcv6?
GHSA-pgcr-7wm4-mcv6 is a security vulnerability in Pem involving Sensitive Data Exposure in pem under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Pem versions are affected?
Affected versions include releases prior to 1.13.2 across affected packages: pem.
What version fixes GHSA-pgcr-7wm4-mcv6?
Upgrading to 1.13.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pem affected?
Yes, pem is affected in releases prior to 1.13.2. Upgrade your dependency to 1.13.2 or later.
What is the CVSS score of GHSA-pgcr-7wm4-mcv6?
GHSA-pgcr-7wm4-mcv6 has a CVSS v3.1 base score of 7.5 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with GHSA-pgcr-7wm4-mcv6?
GHSA-pgcr-7wm4-mcv6 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check npm dependencies for GHSA-pgcr-7wm4-mcv6?
Run the dependency tree command: 'npm ls pem'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pgcr-7wm4-mcv6",
  "modified" : "2021-08-04T21:28:00Z",
  "published" : "2019-06-04T15:42:45Z",
  "aliases" : [ ],
  "summary" : "Sensitive Data Exposure in pem",
  "details" : "Versions of `pem` before 1.13.2 expose sensitive data when the `readPkcs12` is used. \n\nThe `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.\n\n\n\n## Recommendation\n\nUpdate to version 1.13.2 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "pem"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.13.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Dexus/pem/pull/217"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Dexus/pem/commit/bed1190e4a08692ac903ae6043489f1f76bc67eb"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-PEM-173687"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/723"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-06-04T15:41:30Z",
    "nvd_published_at" : null
  }
}