# CVE-2019-0542: xterm vulnerable to remote code execution

> Attackers can execute arbitrary code remotely by exploiting improper handling of special characters in the xterm.js terminal library.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 9 Jan 2019
- **Updated:** 4 Aug 2024
- **Also known as:** DEBIAN-CVE-2019-0542, GHSA-mc23-976p-j42x, RHSA-2019:1422, RHSA-2019:2551, RHSA-2019:2552

## What is CVE-2019-0542?

CVE-2019-0542 is a high-severity code injection vulnerability in Redhat Openshift Container Platform, published on 9 Jan 2019. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

A remote code execution vulnerability exists in Xterm.js when the component mishandles special characters, aka "Xterm Remote Code Execution Vulnerability." This affects xterm.js.

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2019-0542?

6 open source packages ship an affected version, including xterm. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `xterm` | npm | All versions | 3.8.1 |
| `xterm` | npm | All versions | 3.8.1 |
| `xterm` | npm | From 3.10.0 | 3.10.1 |
| `xterm` | npm | From 3.10.0 | 3.10.1 |
| `xterm` | npm | From 3.9.0 | 3.9.2 |
| `xterm` | npm | From 3.9.0 | 3.9.2 |
| `atomic-openshift-web-console` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.163-1.git.1.c3a2131.el7 |
| `atomic-openshift-web-console` | Red Hat:openshift:3.11::el7 | All versions | 0:3.11.104-1.git.1.3c3a7f2.el7 |
| `atomic-openshift-web-console` | Red Hat:openshift:3.9::el7 | All versions | 0:3.9.99-1.git.1.49cd7e9.el7 |

Products: Redhat Openshift Container Platform, Xtermjs Xterm.js.

## How do I fix CVE-2019-0542?

Upgrade xterm to a fixed version for your release line: 3.8.1, 3.10.1 or 3.9.2.

## Is CVE-2019-0542 being exploited?

There is no known exploitation of CVE-2019-0542 in the wild and no public exploit code.

## Other vulnerabilities in Redhat Openshift Container Platform

- [CVE-2020-27836](https://insights.sbomify.com/CVE-2020-27836/): Missing authorization in cluster-ingress-operator (critical 9.8)
- [CVE-2018-1085](https://insights.sbomify.com/CVE-2018-1085/): Misconfiguration in openshift-ansible (critical 9.0)
- [CVE-2026-54099](https://insights.sbomify.com/CVE-2026-54099/): Privilege escalation in Red Hat OpenShift Container Platform 4 (high 8.8)
- [CVE-2026-1784](https://insights.sbomify.com/CVE-2026-1784/): Ose-cluster-ingress-operator: remote code execution through haproxy configuration injection (high 8.8)
- [CVE-2021-20182](https://insights.sbomify.com/CVE-2021-20182/): Privilege escalation in openshift (high 8.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2019-0542 and fix it if it is affected.

What it is: CVE-2019-0542 is a high-severity code injection vulnerability in Redhat Openshift Container Platform, published on 9 Jan 2019. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2019-0542 in the wild and no public exploit code.

Affected packages and fixed versions:
- xterm (npm): affected all versions; fixed in 3.8.1
- xterm (npm): affected all versions; fixed in 3.8.1
- xterm (npm): affected from 3.10.0; fixed in 3.10.1
- xterm (npm): affected from 3.10.0; fixed in 3.10.1
- xterm (npm): affected from 3.9.0; fixed in 3.9.2
- xterm (npm): affected from 3.9.0; fixed in 3.9.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2019-0542/ (Markdown: https://insights.sbomify.com/CVE-2019-0542/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2019-0542
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2019-0542
- OSV: https://osv.dev/vulnerability/CVE-2019-0542

---
From sbomify Insights: https://insights.sbomify.com/CVE-2019-0542/
Summaries are generated and may contain mistakes; the official description above is the record.
