CVE-2026-58191: Appium Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-3wgp-x9p5-c7cc
CVSS 6.5
CWE-489 CWE-79
Published
Advisory Summary

CVE-2026-58191 is a MODERATE (CVSS 6.5) cross-site scripting vulnerability (CWE-489: Active Debug Code) affecting Appium libraries in the npm ecosystem. The issue involves reflected xss / arbitrary js in @appium/base-driver /test/guinea-pig* routes. Remediation is available by upgrading affected packages to version 10.7.0.

CVE-2026-58191 at a Glance

CVE Identifier CVE-2026-58191
GHSA Identifier GHSA-3wgp-x9p5-c7cc
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-489: Active Debug Code
Affected Product Appium
Package Ecosystem npm
Published Date
Last Updated

Security Impact

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

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 None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-58191

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

@appium/base-driver fixed: 10.7.0
npm install @appium/base-driver@10.7.0
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 @appium/base-driver

How to Check if You Are Affected

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

npm ls @appium/base-driver

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

Note: The npm ls @appium/base-driver 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-489: Active Debug Code, where the product is released with debugging code still enabled or active. In Appium, 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

## Summary Appium's base-driver mounts the built-in `/test/guinea-pig`, `/test/guinea-pig-scrollable` and `/test/guinea-pig-app-banner` routes **unconditionally** on every server. The handler reflects the `throwError` query param, the `comments` POST field, and the `User-Agent` request header into the returned HTML via `compileLodashTemplate`, which interpolates `<%= expr %>` as `String(expr)` with **no HTML/JS escaping**. This yields reflected XSS, and the `throwError` value is reflected **inside a `<script>` block**, giving arbitrary JavaScript execution on the server's origin. No authentication, no session, no driver and no plugin are required, and the default bind address is `0.0.0.0`. ## Details ### Affected - `@appium/base-driver` **10.6.0** (with Appium server **3.5.0**); tested live. - Template engine helper: `@appium/base-driver` `lib/utils.ts` `compileLodashTemplate`. ### Location (file:line) - Routes mounted unconditionally: `base-driver/lib/express/server.ts:216-219` (`app.all('/test/guinea-pig', guineaPig)` etc.). - Tainting: `base-driver/lib/express/static.ts:35-61` (`guineaPigTemplate`) — `throwError = String(req.params.throwError ?? req.query?.throwError)`, `params.comment = String(req.body.comments)`, `params.userAgent = req.headers['user-agent']`. - Unescaped render: `base-driver/lib/utils.ts:67-83` (`compileLodashTemplate`) emits `<%= expr %>` as `String(${expr})` via `new Function(...)`, no escaping. - Sinks (shipped templates): `base-driver/static/test/guinea-pig.html:11-12` (`throwError` inside `<script>`), `:50` (`comment`), `:87` (`userAgent`); same in `guinea-pig-scrollable.html` / `guinea-pig-app-banner.html`. ### PoC Requests: ``` GET /test/guinea-pig?throwError=x%27%2balert(document.domain)%2b%27 POST /test/guinea-pig (body: comments=</span><img src=x onerror=alert(1)>) GET /test/guinea-pig (header: User-Agent: <script>alert(7)</script>) ``` <img width="973" height="276" alt="image" src="https://github.com/user-attachments/assets/f58e1dce-f3ad-43d3-b66e-1ff5efea3866" /> ### Impact An attacker who can get a victim to open a crafted link (or auto-submit a form) to the Appium server executes arbitrary JavaScript on the server's origin. With default CORS `*` + no authentication, that JS can drive the WebDriver REST API and plugin endpoints. The endpoints are debug/test fixtures that should not be reachable on a production listener at all.

CVE-2026-58191 Affected Appium Versions

1 component(s)
Fixed Versions:
10.7.0
Product / Package Ecosystem Affected Versions Fixed Version
@appium/base-driver
npm
< 10.7.0
10.7.0

References

Frequently Asked Questions

What is CVE-2026-58191?
CVE-2026-58191 is a security vulnerability in Appium involving Reflected XSS / arbitrary JS in @appium/base-driver /test/guinea-pig* routes under CWE-489: Active Debug Code.
Which Appium versions are affected?
Affected versions include releases prior to 10.7.0 across affected packages: @appium/base-driver.
What version fixes CVE-2026-58191?
Upgrading to 10.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @appium/base-driver affected?
Yes, @appium/base-driver is affected in releases prior to 10.7.0. Upgrade your dependency to 10.7.0 or later.
What is the CVSS score of CVE-2026-58191?
CVE-2026-58191 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-58191?
CVE-2026-58191 is classified under CWE-489: Active Debug Code (The product is released with debugging code still enabled or active.).
How can I check npm dependencies for CVE-2026-58191?
Run the dependency tree command: 'npm ls @appium/base-driver'. 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-3wgp-x9p5-c7cc",
  "modified" : "2026-09-01T18:54:53Z",
  "published" : "2026-09-01T18:54:53Z",
  "aliases" : [ "CVE-2026-58191" ],
  "summary" : "Appium: Reflected XSS / arbitrary JS in @appium/base-driver /test/guinea-pig* routes",
  "details" : "## Summary\n\nAppium's base-driver mounts the built-in `/test/guinea-pig`, `/test/guinea-pig-scrollable` and `/test/guinea-pig-app-banner` routes **unconditionally** on every server. The handler reflects the `throwError` query param, the `comments` POST field, and the `User-Agent` request header into the returned HTML via `compileLodashTemplate`, which interpolates `<%= expr %>` as `String(expr)` with **no HTML/JS escaping**. This yields reflected XSS, and the `throwError` value is reflected **inside a `<script>` block**, giving arbitrary JavaScript execution on the server's origin. No authentication, no session, no driver and no plugin are required, and the default bind address is `0.0.0.0`.\n\n## Details\n\n### Affected\n- `@appium/base-driver` **10.6.0** (with Appium server **3.5.0**); tested live.\n- Template engine helper: `@appium/base-driver` `lib/utils.ts` `compileLodashTemplate`.\n\n### Location (file:line)\n- Routes mounted unconditionally: `base-driver/lib/express/server.ts:216-219`\n(`app.all('/test/guinea-pig', guineaPig)` etc.).\n- Tainting: `base-driver/lib/express/static.ts:35-61` (`guineaPigTemplate`) —\n`throwError = String(req.params.throwError ?? req.query?.throwError)`, `params.comment = String(req.body.comments)`, `params.userAgent = req.headers['user-agent']`.\n- Unescaped render: `base-driver/lib/utils.ts:67-83` (`compileLodashTemplate`)\nemits `<%= expr %>` as `String(${expr})` via `new Function(...)`, no escaping.\n- Sinks (shipped templates): `base-driver/static/test/guinea-pig.html:11-12`\n(`throwError` inside `<script>`), `:50` (`comment`), `:87` (`userAgent`); same in `guinea-pig-scrollable.html` / `guinea-pig-app-banner.html`.\n\n\n### PoC\n\nRequests:\n```\nGET /test/guinea-pig?throwError=x%27%2balert(document.domain)%2b%27\nPOST /test/guinea-pig         (body: comments=</span><img src=x onerror=alert(1)>)\nGET  /test/guinea-pig         (header: User-Agent: <script>alert(7)</script>)\n```\n\n<img width=\"973\" height=\"276\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f58e1dce-f3ad-43d3-b66e-1ff5efea3866\" />\n\n\n### Impact\n\nAn attacker who can get a victim to open a crafted link (or auto-submit a form) to the Appium server executes arbitrary JavaScript on the server's origin. With default CORS `*` + no authentication, that JS can drive the WebDriver REST API and plugin endpoints. The endpoints are debug/test fixtures that should not be reachable on a production listener at all.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@appium/base-driver"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "10.7.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 10.6.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/appium/appium/security/advisories/GHSA-3wgp-x9p5-c7cc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-58191"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/appium/appium/pull/22394"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/appium/appium/commit/d94a40af9f8040191ee7888571a1c9d5aec59f89"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/appium/appium"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/appium/appium/releases/tag/@appium/base-driver@10.7.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-489", "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-01T18:54:53Z",
    "nvd_published_at" : "2026-07-08T21:16:52Z"
  }
}