Summary
Flux159 mcp-game-asset-gen 0.1.0 contains a path traversal vulnerability in the MCP Interface's image_to_3d_async function, where the statusFile argument is not properly constrained.
A remote attacker who can influence this parameter may traverse directories on the server filesystem, potentially accessing or manipulating files outside the intended path.
Affected context
The vulnerability appears in the MCP Interface component of Flux159 mcp-game-asset-gen, specifically within src/index.ts in the image_to_3d_async function.
It manifests when user-controlled values are accepted for the statusFile argument and then used to construct filesystem paths without sufficient validation or normalization.
Deployments that expose this interface over a network (e.g., via an API or MCP endpoint) and allow clients to specify or influence statusFile are more likely to be affected.
Exploit preconditions
- Attack surface: Remote interface to the MCP component (e.g., HTTP, MCP protocol, or other API used to invoke
image_to_3d_async). - Required access: Ability to send requests or messages that control or influence the
statusFileparameter. - Trigger point: Invocation of
image_to_3d_asyncwherestatusFileis incorporated into a file path for reading, writing, or updating status. - Why exploitation is possible: The implementation appears to trust
statusFileinput and combine it with base directories or file operations without adequately stripping, normalizing, or restricting directory traversal sequences such as../, enabling paths that escape the intended directory.
Why this happens
This issue aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
The underlying flaw is that the code uses user-influenced path segments (statusFile) directly in filesystem operations, relying on assumptions about where files will reside rather than enforcing canonical constraints.
Without proper validation, normalization, or enforcement of a fixed base directory, attackers can inject path segments that step out of the intended directory tree and target arbitrary files on the host system.
Potential impact
- Unauthorized reading of files that the application process can access, including configuration files or logs.
- Overwriting or corrupting application-related files such as status files, temporary data, or other assets.
- Interference with application behavior by modifying files used to track job state or results.
- In some environments, potential escalation to code execution if writable files such as scripts or configuration files are altered and subsequently executed or loaded.
General mitigation guidance
Effective mitigation focuses on strict control of file paths derived from external input:
- Constrain
statusFileto a known safe directory and reject any value that resolves outside this directory after canonicalization. - Normalize and validate paths, explicitly disallowing sequences like
../, absolute paths, or symbolic link traversal where not needed. - Prefer using whitelists of allowed filenames or identifiers rather than accepting arbitrary path segments from clients.
- Implement a clear separation between user identifiers and filesystem names, mapping user-supplied identifiers to server-chosen paths instead of embedding user data directly in paths.
- Run the service with least-privilege filesystem permissions so that even if traversal occurs, the accessible damage is reduced.
How teams detect issues like this
Teams can detect and monitor for similar issues using a combination of review and tooling:
- Static analysis rules that flag direct concatenation of user-controlled variables into file paths or filesystem APIs (
fs.readFile,fs.writeFile,fs.createWriteStream, etc.). - Code review checklists that require reviewers to verify any input-derived path is resolved, canonicalized, and restricted to a known base directory.
- Logging and monitoring of unexpected path patterns, especially those containing
../, absolute paths, or references outside the normal working directories. - Security tests or fuzzing focused on file-handling endpoints, sending crafted
statusFilevalues with traversal sequences and confirming they are rejected.

