Vulnerabilities in pkg:npm/xterm

PACKAGE
Advisory Identifier: GHSA-mc23-976p-j42x
Advisory Summary

CVE-2019-0542 is a HIGH (CVSS 8.8) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Xterm libraries in the npm ecosystem. The issue involves xterm vulnerable to remote code execution. Remediation is available by upgrading affected packages to version 3.8.1, 3.9.2, 3.10.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/xterm

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-mc23-976p-j42x CVE-2019-0542 HIGH xterm vulnerable to remote code execution

CVE-2019-0542 at a Glance

CVE Identifier CVE-2019-0542
GHSA Identifier GHSA-mc23-976p-j42x
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Xterm
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.8

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:R/S:U/C:H/I:H/A:H).

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

How to Fix CVE-2019-0542

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

xterm fixed: 3.8.1
npm install xterm@3.8.1
xterm fixed: 3.9.2
npm install xterm@3.9.2
xterm fixed: 3.10.1
npm install xterm@3.10.1
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 xterm

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2019-0542, inspect your project dependencies using npm:

npm ls xterm

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

Note: The npm ls xterm 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Xterm, 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

A remote code execution vulnerability exists in Xterm.js when the component mishandles special characters.

CVE-2019-0542 Affected Xterm Versions

3 component(s)
Fixed Versions:
3.8.13.9.23.10.1
Product / Package Ecosystem Affected Versions Fixed Version
xterm
npm
< 3.8.1
3.8.1
xterm
npm
≥ 3.9.0
< 3.9.2
3.9.2
xterm
npm
≥ 3.10.0
< 3.10.1
3.10.1

References

Frequently Asked Questions

What is CVE-2019-0542?
CVE-2019-0542 is a security vulnerability in Xterm involving xterm vulnerable to remote code execution under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Xterm versions are affected?
Affected versions include releases prior to 3.8.1, 3.9.2, 3.10.1 across affected packages: xterm.
What version fixes CVE-2019-0542?
Upgrading to 3.8.1, 3.9.2, 3.10.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is xterm affected?
Yes, xterm is affected in releases prior to 3.8.1, 3.9.2, 3.10.1. Upgrade your dependency to 3.8.1, 3.9.2, 3.10.1 or later.
What is the CVSS score of CVE-2019-0542?
CVE-2019-0542 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2019-0542?
CVE-2019-0542 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2019-0542?
Run the dependency tree command: 'npm ls xterm'. 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-mc23-976p-j42x",
  "modified" : "2022-12-18T23:44:26Z",
  "published" : "2019-01-14T16:19:55Z",
  "aliases" : [ "CVE-2019-0542" ],
  "summary" : "xterm vulnerable to remote code execution ",
  "details" : "A remote code execution vulnerability exists in Xterm.js when the component mishandles special characters.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "xterm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.8.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "xterm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.9.0"
      }, {
        "fixed" : "3.9.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "xterm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.10.0"
      }, {
        "fixed" : "3.10.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-0542"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/xtermjs/xterm.js/commit/3592c641cd0348e0b698e8a180aea2072c6bcd9a"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHBA-2019:0959"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2019:1422"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2019:2551"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2019:2552"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-mc23-976p-j42x"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/xtermjs/xterm.js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/xtermjs/xterm.js/releases/tag/3.8.1"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/106434"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:45:48Z",
    "nvd_published_at" : "2019-01-09T15:29:00Z"
  }
}