CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-X975-RGX4-5FH4

GHSA-X975-RGX4-5FH4: Unescaped Locator Data Cross-Site Scripting in appium-mcp MCP-UI Resource

Alon Barad
Alon Barad
Software Engineer

Jun 22, 2026·6 min read·47 visits

Executive Summary (TL;DR)

A Cross-Site Scripting (XSS) vulnerability in the Appium Model Context Protocol (MCP) server allows unescaped layout metadata to execute malicious JavaScript in the client's inspector WebView, leading to arbitrary host command execution via postMessage exploitation.

GHSA-X975-RGX4-5FH4 is a high-severity Cross-Site Scripting (XSS) vulnerability residing in the Model Context Protocol (MCP) User Interface (UI) component of appium-mcp, an NPM package integrating Appium with MCP clients. The flaw exists within the createLocatorGeneratorUI utility function, which renders UI metadata directly into an HTML template page without performing sanitization or encoding. Because MCP clients use window.parent.postMessage to send commands from the UI to the host, this XSS can be escalated to trigger arbitrary MCP tool calls, potentially leading to Remote Code Execution (RCE) on the host running the MCP client.

Vulnerability Overview

The appium-mcp package provides an integration layer that allows Model Context Protocol (MCP) clients to interact with Appium servers. This integration exposes automated testing functions to external clients and LLM agents. Part of this interface includes a User Interface (UI) component designed to assist users in identifying and generating element locators.

Within this UI component, the utility function createLocatorGeneratorUI compiles layout metadata retrieved from an active Appium session into an interactive HTML dashboard. This interface is loaded within an iframe or desktop application WebView wrapper. Because the metadata represents live element parameters, it is subject to external control from the application under test.

An architectural security boundaries failure occurs when the package parses unencoded layout attributes into the generated HTML document. The vulnerability, tracked as GHSA-X975-RGX4-5FH4, belongs to the Improper Neutralization of Input During Web Page Generation class (CWE-79). If an application under test returns malicious UI parameters, the payload executes scripting in the host UI context.

Root Cause Analysis

The core weakness lies in src/ui/mcp-ui-utils.ts inside the createLocatorGeneratorUI function. When generating the locator cards, the function directly injects dynamic element properties like tagName, text, contentDesc, and resourceId using standard ES6 template string interpolation. This mechanism assumes that Appium driver node data is implicitly trusted and well-formed.

Appium nodes are populated dynamically by parsing the target application layout XML or HTML source code. Attackers who control the application interface can populate these fields with arbitrary text. Because the template generator does not sanitize or escape HTML entities, any HTML tag or executable payload embedded in these attributes is rendered directly into the DOM tree of the local inspector.

A secondary, compounding flaw exists in how the test button attributes are structured. The template attempts to construct an inline JavaScript event handler using the onclick attribute. Although the code attempts to escape backticks within the selector string using a basic regular expression replace function, it neglects other metacharacters like single quotes and double quotes, facilitating attribute breakout.

Code-Level Analysis and Patch Breakdown

Comparing the vulnerable implementation with the patched version reveals how the authors resolved both injection vectors. In the vulnerable code, the template directly rendered property values like element.text and element.resourceId inside HTML block tags. The patch introduces a dedicated helper named escapeHtml that translates HTML meta-characters into safe character entity references.

The escaping routine targets characters key to XML and HTML parsing, specifically mapping ampersand, less-than, greater-than, double-quote, and single-quote characters to their respective entity names. By executing escapeHtml(element.text) and wrapping other fields similarly, any potential markup payload is forced to render strictly as static text content rather than active executable structures.

Additionally, the patch removes the inline onclick handler completely. Rather than attempting complex and brittle regex escaping of the strategy and selector inside string literals, the new implementation saves these variables inside HTML5 data attributes. It then implements a centralized, secure event delegation handler registered at the document scope.

Below is the technical code analysis contrasting the vulnerable string interpolation patterns with the secure entity-escaped model:

// VULNERABLE APPROACH IN src/ui/mcp-ui-utils.ts
${element.text ? `<p class="element-text"><strong>Text:</strong> ${element.text}</p>` : ''}
<button class="test-btn" onclick="testLocator('${strategy}', \`${selector.replace(/`/g, '\\`')}\`)">Test</button>
 
// SECURE RESOLUTON IN v1.85.10
${element.text ? `<p class="element-text"><strong>Text:</strong> ${escapeHtml(element.text)}</p>` : ''}
<button class="test-btn" data-strategy="${escapeHtml(strategy)}" data-selector="${escapeHtml(selector)}">Test</button>

The centralized document event listener processes clicks on elements matching .test-btn and queries datasets natively, precluding javascript runtime execution during the compilation phase.

Exploitation Methodology

Exploitation of GHSA-X975-RGX4-5FH4 relies on an attacker injecting HTML formatting elements into the UI tree of an active application being automated or scanned. For example, a web page or mobile screen designed for user submission could include a text field containing an image payload. When Appium extracts this hierarchy via standard API actions, the server receives the payload.

Once the payload is stored inside the local page source or element properties, an automated testing tool or LLM client calls the Appium MCP locator generation interface. The package compiles the locator generator UI on the server side and transmits the unescaped raw string structure to the client rendering frame.

During rendering inside the WebView component, the browser DOM parser encounters the unescaped tags. A target image tag such as <img src="invalid_path" onerror="[payload]"> fires immediately due to loading failure. The script execution environment is identical to that of the locator interface, which contains active postMessage configurations mapping parent execution bindings.

The following system workflow diagram visualizes the payload injection lifecycle, showing how an untrusted target application exploits the client inspector environment:

Downstream Impact Assessment

The technical impact of this cross-site scripting flaw extends far beyond standard DOM manipulation. Because Model Context Protocol clients are intended to link natural language systems or clients to local host execution environments, they register helper tools that can write files, execute scripts, and invoke binary packages.

If the client interface (such as Claude Desktop or specialized test automation clients) exposes the locator generator within an embedded frame, the parent document frequently processes frame event commands. An injected payload can issue structured postMessage frames to trigger registered client tool schemas.

This transition shifts the impact from standard client-side browser context manipulation to local server-side access. Since MCP client setups are authorized to run shell tools with administrative privileges on local workstations, execution of the frame-level payload can lead directly to remote execution of unauthorized shell instructions.

Remediation and Defensive Engineering

The primary corrective measure is upgrading the appium-mcp package to version v1.85.10 or higher, which replaces vulnerable dynamic string layouts with the escaped DOM property format. The update can be integrated via npm using standard package updates.

In environments where an immediate package update is not feasible, security administrators must implement rigid Content Security Policy (CSP) headers within the rendering environment of the MCP UI wrapper. Restricting script execution by disallowing unsafe-inline directives within the layout viewer iframe will disable inline element event evaluation.

Additionally, developers must review cross-origin communication models in their MCP host environments. Direct execution of administrative tools triggered through cross-frame postMessage requests must be audited. Implementing rigorous origin validation and requiring direct human verification for critical host tool executions mitigates sandbox escape paths.

Official Patches

AppiumOfficial tag release v1.85.10 patch

Fix Analysis (1)

Technical Appendix

CVSS Score
8.2/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
EPSS Probability
0.04%
Top 88% most exploited

Affected Systems

appium-mcp NPM package

Affected Versions Detail

Product
Affected Versions
Fixed Version
appium-mcp
Appium
< 1.85.101.85.10
AttributeDetail
CWE IDCWE-79
Attack VectorNetwork
CVSS Score8.2 (High)
Exploit StatusProof-of-Concept
KEV StatusNot Listed
ImpactClient-Side Script Execution / Host Command Injection via postMessage

MITRE ATT&CK Mapping

T1189Drive-by Compromise
Initial Access
T1204.001User Execution: Malicious Link
Execution
T1204.002User Execution: Malicious File
Execution
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The software does not sanitize or escape user-controlled input before embedding it in HTML pages, allowing attackers to execute arbitrary JavaScript in the user's browser context.

Known Exploits & Detection

GitHub Test SuiteUnit tests demonstrating direct markup injections and bracket-breakout validation

Vulnerability Timeline

Vulnerability identified and fix commit e222bbbd6fe2b656a320efcd143563f08061a83d applied
2026-06-18
Official package version 1.85.10 released on npmjs.com
2026-06-18
GitHub Security Advisory GHSA-X975-RGX4-5FH4 published
2026-06-18

References & Sources

  • [1]GitHub Security Advisory GHSA-X975-RGX4-5FH4

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•1 day ago•CVE-2026-58197
8.8

CVE-2026-58197: Host Escape and Lateral Movement via Insecure Container Network Defaults in ToolHive

A high-severity access control vulnerability in ToolHive CLI before v0.30.1 and ToolHive Studio before v0.38.0 allows local containerized MCP servers to bypass network isolation. This enables malicious workloads to establish TCP/IP connections to administrative and control plane endpoints exposed on the host loopback interface.

Amit Schendel
Amit Schendel
7 views•8 min read
•1 day ago•CVE-2026-63405
5.9

CVE-2026-63405: Insufficient Verification of Data Authenticity in AnyCable Pusher REST API

AnyCable is a real-time communication server. Prior to version 1.6.15, its Pusher-compatible REST API suffered from an authentication bypass vulnerability because it failed to verify that the request body matched the signature-validated body_md5 parameter. This allows attackers to perform replay attacks with modified body contents.

Amit Schendel
Amit Schendel
8 views•5 min read
•1 day ago•CVE-2026-64847
6.8

CVE-2026-64847: Indefinite Denial of Service via Undrained Stderr in AnyIO Process Pool Workers

A denial-of-service vulnerability exists in AnyIO prior to version 4.14.2. Standard error streams of process-pool workers are connected to an operating system pipe that is never drained by the parent process. This allows a worker to fill the pipe buffer and deadlock indefinitely.

Amit Schendel
Amit Schendel
7 views•6 min read
•1 day ago•CVE-2026-63349
7.0

CVE-2026-63349: Privilege Dropping Bypass and Denial of Service in AnyIO Subprocess Module

CVE-2026-63349 is a critical privilege-dropping bypass vulnerability in the AnyIO asynchronous framework (versions 4.14.0 and 4.14.1) on POSIX platforms. Due to a variable assignment typo, supplementary groups specified by the developer are not correctly propagated to the execution backend, resulting in subprocesses retaining the parent process's elevated supplementary group permissions.

Alon Barad
Alon Barad
12 views•5 min read
•1 day ago•CVE-2026-63406
5.9

CVE-2026-63406: Information Disclosure via Insecure Telemetry and Hardcoded Credentials in AnyCable-Go

CVE-2026-63406 is an information disclosure vulnerability in AnyCable-go prior to version 1.6.15. The built-in telemetry client is enabled by default with a hardcoded public authentication token ('secret'). This client digests highly sensitive configuration parameters and command-line arguments, including JWT secrets and RPC secrets, into a stable SHA-256 fingerprint. This fingerprint is sent over public networks, exposing those administrative secrets to offline dictionary and brute-force attacks if intercepted.

Alon Barad
Alon Barad
7 views•5 min read
•1 day ago•CVE-2026-84992
6.1

CVE-2026-84992: Cross-Site Scripting (XSS) via Fenced Code Block Parsing in md-editor-v3

CVE-2026-84992 is a Cross-Site Scripting (XSS) vulnerability affecting md-editor-v3 before version 6.5.4. It occurs because the fenced-code block language parser directly interpolates unescaped language metadata into unquoted HTML attributes inside the custom rendering callback. This bypasses the built-in XSSPlugin which runs during the parsing phase, before rendering.

Amit Schendel
Amit Schendel
9 views•6 min read