{"id":"PYSEC-2026-2894","summary":"PPTAgent: Arbitrary File Write via `save_generated_slides`","details":"## Summary\n\n\u003e This vulnerability has been fixed in https://github.com/icip-cas/PPTAgent/commit/418491a9a1c02d9d93194b5973bb58df35cf9d00.\n\nThe `save_generated_slides` MCP tool accepts a pptx_path argument and writes the generated PPTX file to that path without any workspace restriction or path validation:\n\n```python\n# pptagent/mcp_server.py:288-300\nasync def save_generated_slides(pptx_path: str):\n    \"\"\"Save the generated slides to a PowerPoint file.\n\n    Args:\n        pptx_path: The path to save the PowerPoint file\n    \"\"\"\n    pptx = Path(pptx_path)\n    assert len(self.slides), (\n        \"No slides generated, please call `generate_slide` first\"\n    )\n    pptx.parent.mkdir(parents=True, exist_ok=True)   # ← creates arbitrary directories\n    self.empty_prs.save(pptx_path)                    # ← writes to arbitrary path\n```\n\nThe call to `pptx.parent.mkdir(parents=True, exist_ok=True)` creates any intermediate directories, and `self.empty_prs.save(pptx_path)` writes a valid PPTX binary (ZIP archive) to the specified path. No is_relative_to(workspace) check is performed — contrast with download_file in deeppresenter/tools/search.py:290, which correctly enforces workspace confinement.\n\nThe server changes directory to WORKSPACE (if set) on startup, so relative paths land in the workspace. Absolute paths, however, reach any filesystem location accessible to the server process.\n\n## Impact\n\nThe concrete attack scenarios include\n\n1. Cron persistence (root-running server): `pptx_path = \"/etc/cron.d/backdoor\"` → writes a PPTX ZIP to a path the cron daemon reads; if the ZIP header is misinterpreted, this may corrupt cron or be exploitable depending on parser behaviour.\n2. Dot-file overwrite: `pptx_path = \"/home/user/.bashrc\"` → overwrites shell init file with a binary blob containing arbitrary content in the PPTX's embedded comments/custom properties.\n3. Directory traversal from workspace: `pptx_path = \"../../.ssh/known_hosts.pptx\"` → escapes workspace entirely.\n4. Denial of service: `pptx_path = \"/dev/sda\"` writes to a raw device.\n\n## Remediation\n\nThe potential fix is something like:\n\n```python\nasync def save_generated_slides(pptx_path: str):\n    workspace = Path(os.getcwd()).resolve()\n    target = Path(pptx_path).resolve()\n    if not target.is_relative_to(workspace):\n        raise ValueError(f\"Access denied: path outside workspace: {target}\")\n    target.parent.mkdir(parents=True, exist_ok=True)\n    self.empty_prs.save(str(target))\n```","aliases":["CVE-2026-42080","GHSA-pxhg-7xr2-w7xg"],"modified":"2026-07-13T16:33:00.027297267Z","published":"2026-07-13T15:15:37.675795Z","references":[{"type":"WEB","url":"https://github.com/icip-cas/PPTAgent/security/advisories/GHSA-pxhg-7xr2-w7xg"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42080"},{"type":"WEB","url":"https://github.com/icip-cas/PPTAgent/commit/418491a9a1c02d9d93194b5973bb58df35cf9d00"},{"type":"PACKAGE","url":"https://github.com/icip-cas/PPTAgent"},{"type":"PACKAGE","url":"https://pypi.org/project/pptagent"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-pxhg-7xr2-w7xg"}],"affected":[{"package":{"name":"pptagent","ecosystem":"PyPI","purl":"pkg:pypi/pptagent"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.1.36"}]}],"versions":["0.2.0","0.2.1","0.2.10","0.2.11","0.2.13","0.2.14","0.2.15","0.2.16","0.2.17","0.2.18","0.2.2","0.2.3","0.2.4","0.2.5","0.2.6","0.2.7","0.2.8","0.2.9","1.0.0","1.0.1","1.0.2","1.1.1","1.1.10","1.1.11","1.1.12","1.1.13","1.1.14","1.1.15","1.1.16","1.1.17","1.1.18","1.1.19","1.1.2","1.1.20","1.1.21","1.1.22","1.1.24","1.1.26","1.1.27","1.1.28","1.1.29","1.1.3","1.1.30","1.1.31","1.1.32","1.1.33","1.1.34","1.1.35","1.1.5","1.1.6","1.1.7","1.1.8","1.1.9"],"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/pptagent/PYSEC-2026-2894.yaml"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:L"}]}