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·20 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-54068
5.9

CVE-2026-54068: Unauthenticated Server-Side Template Injection and SQLite Exfiltration in SiYuan PKM

An authentication bypass in the SiYuan personal knowledge management system before version 3.7.0 exposes a dynamic icon rendering endpoint. This endpoint processes client-supplied Go template directives. By submitting a crafted request, an unauthenticated remote attacker can leverage registered database template functions to execute arbitrary read-only SQL queries and exfiltrate workspace contents.

Amit Schendel
Amit Schendel
12 views•5 min read
•1 day ago•CVE-2026-54069
9.1

CVE-2026-54069: Authentication Bypass in SiYuan Note via Origin Header Spoofing

CVE-2026-54069 is a critical authentication bypass vulnerability in the SiYuan Note personal knowledge management system. The flaw is located in the HTTP server's middleware handling API authorization, which unconditionally trusts requests carrying a 'chrome-extension://' scheme in the Origin HTTP header, granting administrative access without validating API tokens.

Alon Barad
Alon Barad
10 views•5 min read
•2 days ago•CVE-2026-54089
9.1

CVE-2026-54089: Authentication Bypass by Spoofing in File Browser

CVE-2026-54089 is a critical authentication bypass vulnerability in File Browser affecting instances configured with proxy-based authentication. An unauthenticated remote attacker with direct network access can impersonate arbitrary users or register new accounts by spoofing configured HTTP headers.

Amit Schendel
Amit Schendel
8 views•7 min read
•2 days ago•GHSA-99J7-FHR2-XFJ4
10.0

GHSA-99J7-FHR2-XFJ4: Malicious Remote Code Execution Payload in 'exploration' Cargo Crate

The malicious Cargo package 'exploration' was uploaded to the crates.io registry. During compilation or package import, the crate executes code designed to establish an outbound TCP/HTTP connection, download an external second-stage binary, and execute the binary locally on the host machine. This creates an unauthenticated remote code execution vector impacting developer environments and continuous integration pipelines.

Amit Schendel
Amit Schendel
11 views•6 min read
•2 days ago•CVE-2026-54088
9.3

CVE-2026-54088: Pre-Authentication Remote Code Execution in File Browser Hook Authentication

CVE-2026-54088 is a critical command injection vulnerability in File Browser prior to version 2.63.6. When Hook Authentication is enabled, the application interpolates unsanitized credentials into a shell command, allowing unauthenticated remote code execution.

Alon Barad
Alon Barad
9 views•6 min read
•2 days ago•GHSA-QV4M-M73M-8HJ7
8.8

GHSA-qv4m-m73m-8hj7: Authenticated Arbitrary File Upload leading to Remote Code Execution in NotrinosERP

An authenticated remote code execution vulnerability exists in NotrinosERP (versions up to and including 1.0.0) within the Human Resource Management (HRM) module. Users with employee management permissions can upload arbitrary file types, including PHP scripts, which are written directly to a web-accessible directory. This allows for arbitrary code execution in the context of the web-server user.

Alon Barad
Alon Barad
8 views•6 min read