Summary
Appium: Reflected XSS / arbitrary JS in @appium/base-driver /test/guinea-pig* routes
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-driver10.6.0 (with Appium server 3.5.0); tested live.- Template engine helper:
@appium/base-driverlib/utils.tscompileLodashTemplate.
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 %>asString(${expr})vianew Function(...), no escaping. - Sinks (shipped templates):
base-driver/static/test/guinea-pig.html:11-12
(throwErrorinside<script>),:50(comment),:87(userAgent); same inguinea-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>)
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.
Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.
CVE-2026-58191 has a CVSS score of 6.5 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (10.7.0); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-58191? CVE-2026-58191 is a medium-severity cross-site scripting (XSS) vulnerability in @appium/base-driver (npm), affecting versions <= 10.6.0. It is fixed in 10.7.0. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
- How severe is CVE-2026-58191? CVE-2026-58191 has a CVSS score of 6.5 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of @appium/base-driver are affected by CVE-2026-58191? @appium/base-driver (npm) versions <= 10.6.0 is affected.
- Is there a fix for CVE-2026-58191? Yes. CVE-2026-58191 is fixed in 10.7.0. Upgrade to this version or later.
- Is CVE-2026-58191 exploitable, and should I be worried? Whether CVE-2026-58191 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-58191 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-58191? Upgrade
@appium/base-driverto 10.7.0 or later.