/

CVE-2026-33989

Severity:

HIGH RISK

(8.1)

Path Traversal in Mobile Next MCP Screenshot and Screen

CVE-2026-33989

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22, CWE-73

Impact:

Arbitrary File Write Outside Intended Workspace

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

The Mobile Next @mobilenext/mobile-mcp server contained a path traversal vulnerability in the mobile_save_screenshot and mobile_start_screen_recording tools, where user-controlled paths were passed directly to filesystem write operations.

An attacker who can invoke these tools and control the saveTo or output parameters may be able to create or overwrite files outside the intended workspace, potentially impacting system integrity and confidentiality.

Affected context

This vulnerability affects environments using the Mobile Next MCP server where the mobile_save_screenshot or mobile_start_screen_recording tools are exposed to user or client input.

It is most relevant when:

  • The MCP server trusts client-supplied parameters for file destinations
  • The server process has write permissions to directories outside the designated workspace
  • There are no additional layers restricting filesystem access (e.g., strict container sandboxes or chrooted environments)

Under these conditions, crafted path values can redirect screenshot or recording output into unintended locations on the server's filesystem.

Exploit preconditions

  • Attack surface: The Mobile Next MCP server API or any integration that exposes mobile_save_screenshot and mobile_start_screen_recording.
  • Required access: Ability to authenticate to or otherwise invoke the affected tools and control the saveTo or output parameters.
  • Trigger point: Supplying a crafted filesystem path (e.g., using relative traversal or absolute paths) when requesting a screenshot or starting a screen recording.
  • Why exploitation is possible: The server passed the saveTo and output parameters directly to filesystem write operations without normalizing, constraining, or validating the paths against an allowed workspace root, enabling path traversal and arbitrary file write.

Why this happens

The underlying issue is improper restriction of user-supplied file paths, mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') and related to CWE-73: External Control of File Name or Path.

Instead of resolving and validating the target path against a fixed workspace directory, the implementation treated the saveTo and output parameters as trusted, forwarding them directly into file create/write operations.

This pattern allows attackers to escape the intended directory by using relative components or absolute paths, causing writes to arbitrary locations that the server process can access.

Potential impact

  • Creation or overwriting of files outside the intended workspace directory
  • Tampering with application configuration files that are writable by the server process
  • Placement of malicious files or scripts in locations later interpreted or executed by other components
  • Disruption of service by corrupting logs, state files, or other operational data
  • Possible assistance in privilege escalation or lateral movement when combined with other vulnerabilities or misconfigurations

General mitigation guidance

Effective mitigation focuses on constraining and validating filesystem paths before any write operation:

  • Normalize and resolve all user-supplied paths against a defined workspace root, rejecting any that escape this directory.
  • Use allowlists of directories or file name patterns for where screenshots and recordings can be stored.
  • Prefer constructing destination paths server-side from trusted base directories, using only sanitized file name fragments from user input.
  • Run the MCP server under a dedicated, least-privileged account with minimal filesystem write rights.
  • Consider using OS- or container-level sandboxing (e.g., chroot, containers, or restrictive volume mounts) to limit the blast radius of any filesystem misuse.

How teams detect issues like this

Organizations can detect and monitor for this vulnerability and similar patterns by:

  • Applying static analysis rules that flag direct use of user-controlled path parameters in file APIs (e.g., fs.writeFile, fs.createWriteStream) without normalization or validation.
  • Reviewing code for patterns where request or tool parameters map directly to filesystem paths, especially in utility tools like screenshot or logging endpoints.
  • Implementing security-focused code review checklists that include path traversal and externalized file path usage as mandatory review items.
  • Monitoring runtime logs for unusual file write locations, especially outside expected workspace directories or containing traversal sequences, and raising alerts on suspicious path patterns.

Sources

SourceLink
github.comgithub.com/mobile-next/mobile-mcp/commit/f5e32295903128c1e71cf915ae6c0b76c7b0153b
github.comgithub.com/mobile-next/mobile-mcp/releases/tag/0.0.49
github.comgithub.com/mobile-next/mobile-mcp/security/advisories/GHSA-3p2m-h2v6-g9mx

Frequently asked

questions

Exploitability depends on who can invoke the Mobile Next MCP tools and control the saveTo or output parameters. In environments where these tools are exposed to untrusted or semi-trusted clients, the vulnerability can be exploited remotely through normal tool invocation.

The attacker needs whatever level of access is required to call mobile_save_screenshot or mobile_start_screen_recording and supply custom path parameters. No direct OS-level privileges are required beyond the permissions already granted to the MCP server process.

Enforce strict path handling by resolving all user-supplied paths against a predefined workspace root, rejecting any path that escapes that directory, and constructing output paths primarily from trusted server-side directory definitions.

Treat all external file paths as untrusted, centralize path validation logic, and adopt coding standards that:

  • Prohibit direct use of client-supplied paths in file operations
  • Require normalization and boundary checks against approved directories
  • Include automated tests and static analysis rules specifically targeting path traversal and external path control scenarios.
Find out what's already
exploitable in your codebase.