# CVE-2026-50757: DayuanJiang next-ai-draw-io directory traversal in export_diagram tool

Source: https://junglewise.ai/threats/cve-2026-50757-dayuanjiang-next-ai-draw-io-directory-traversal-in-export-diagram  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-21. Updated: 2026-07-21  
License: CC BY 4.0 with a link back

CVE-2026-50757 · Severity: info · CVSS 8.4 · Published 2026-07-21

A vulnerability exists in the next-ai-draw-io MCP server, a tool used to allow AI assistants (like Claude or VS Code Copilot) to create and edit diagrams. Because the software does not properly check where it is saving files, a malicious actor could trick an AI agent into writing files to sensitive locations on a user's computer. This could allow an attacker to overwrite system files or plant malicious code, potentially leading to a full takeover of the user's workstation.

Technologies: [DayuanJiang Next-Ai-Draw-Io](https://junglewise.ai/threats/technologies/next-ai-draw-io). Vendors: [DayuanJiang](https://junglewise.ai/threats/vendors/dayuanjiang).

## Quick answers

**Is CVE-2026-50757 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-50757 being exploited in the wild.

**How severe is CVE-2026-50757?** Informational severity, with a CVSS score of 8.4, published 21 July 2026.

**Which products and versions are affected?** DayuanJiang Next-Ai-Draw-Io <= 0.4.13.

**Is there a fix for CVE-2026-50757?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-50757 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-50757?** Check whether you run DayuanJiang Next-Ai-Draw-Io at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A Path Traversal vulnerability (CWE-22) exists in the `export_diagram` tool of the `@next-ai-drawio/mcp-server` package. The vulnerability stems from the `path` parameter in `packages/mcp-server/src/index.ts` being passed directly to `nodePath.resolve()` and `fs.writeFile()` without any sanitization or validation against a base directory. An attacker can provide traversal sequences (e.g., `../../`) or absolute paths to write attacker-controlled diagram XML content to sensitive locations like `~/.bashrc` or cron directories. While the attack vector is local, it can be triggered remotely via prompt injection against an AI agent that has the MCP server enabled. As of the advisory date, no official patch is confirmed, though the issue has been reported to the vendor.

## Affected products

- DayuanJiang next-ai-draw-io <= 0.4.13
- DayuanJiang @next-ai-drawio/mcp-server <= 0.1.16

## Timeline

- 2026-03-17: disclosed: Vulnerability discovered and reported to vendor via GitHub issue.
- 2026-07-21: advisory: CVE-2026-50757 published.

## References

- [https://github.com/August829/Yu/blob/main/CVE-2026-50757.md](https://github.com/August829/Yu/blob/main/CVE-2026-50757.md)
- [https://github.com/DayuanJiang/next-ai-draw-io/issues/754](https://github.com/DayuanJiang/next-ai-draw-io/issues/754)

## Related threats

- [DayuanJiang next-ai-draw-io reflected XSS in MCP server mcp parameter](https://junglewise.ai/threats/cve-2026-50758-dayuanjiang-next-ai-draw-io-reflected-xss-in-mcp-server-mcp)
- [DayuanJiang next-ai-draw-io SSRF guard bypass in x-ai-provider](https://junglewise.ai/threats/cve-2026-50756-dayuanjiang-next-ai-draw-io-ssrf-guard-bypass-in-x-ai-provider)
- [DayuanJiang next-ai-draw-io auth bypass via X-Forwarded-For spoofing](https://junglewise.ai/threats/cve-2026-50755-dayuanjiang-next-ai-draw-io-auth-bypass-via-x-forwarded-for)
- [Next AI Draw.io is a next.js web application that integrates AI capabilities with draw.io diagrams. Prior to 0.4.15…](https://junglewise.ai/threats/cve-2026-40608-next-ai-draw-io-is-a-next-js-web-application-that-integrates-ai)
