CVE-2026-42078: PPTAgent Arbitrary File Write + Directory Vulnerability

MODERATE
Advisory Identifier: GHSA-hrcw-xc63-g29m
CVSS 4.6
CWE-22
Published
Advisory Summary

CVE-2026-42078 is a MODERATE (CVSS 4.6) arbitrary file write + directory vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting PPTAgent libraries in the PyPI ecosystem. The issue involves arbitrary file write + directory creation via markdown_table_to_image. Remediation is available by upgrading affected packages to version 1.1.36.

CVE-2026-42078 at a Glance

CVE Identifier CVE-2026-42078
GHSA Identifier GHSA-hrcw-xc63-g29m
Severity MODERATE
CVSS v3.1 Base Score 4.6
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product PPTAgent
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2026-42078

To remediate this vulnerability, upgrade all affected PPTAgent dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pptagent fixed: 1.1.36
pip install pptagent>=1.1.36
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pptagent

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-42078, inspect your installed packages using pip:

pip show pptagent

Analyze the terminal output to locate any version of PPTAgent in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.36), your application is affected.

Note: The pip show pptagent command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In PPTAgent, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary The `markdown_table_to_image` tool accepts a caller-controlled path parameter and passes it directly to `get_html_table_image`: ```python # pptagent/mcp_server.py:127-143 def markdown_table_to_image(markdown_table: str, path: str, css: str) -> str: """ Args: path (str): The file path where the image will be saved """ html = markdown_to_html(markdown_table) get_html_table_image(html, path, css) # ← no path validation return f"Markdown table converted to image and saved to {path}" # pptagent/utils.py:337-366 def get_html_table_image(html: str, output_path: str, css: str = None): parent_dir, base_name = os.path.split(output_path) if parent_dir and not os.path.exists(parent_dir): os.makedirs(parent_dir) # ← creates arbitrary directories hti = Html2Image(...) hti.screenshot( html_str=html, css_str=css, save_as=base_name, # ← writes image to any directory size=(1000, 600), ) ``` `os.makedirs(parent_dir)` creates arbitrary directory trees, and `Html2Image.screenshot` writes the rendered image to `parent_dir/base_name`. Unlike `download_file` in the same project, there is no `is_relative_to(workspace)` guard. This behaviour can be fixed with the same pattern as the above. ### Impact The concrete attack scenarios include - SSH key replacement: `path = "/home/user/.ssh/authorized_keys"` — replaces the authorized_keys file with an image binary (breaks - SSH but could be an image crafted with a specific PNG/JPEG payload). - Web shell: `path = "/var/www/html/uploads/shell.php"` — writes the rendered PNG there; the file has the .php extension but PNG content; combined with Apache Options +MultiViews or file-include vulnerabilities could be dangerous. - Directory creation oracle: `path = "/root/test/probe.png"` — if the directory is created, confirms the target path exists; if it errors, reveals permissions information.

CVE-2026-42078 Affected PPTAgent Versions

1 component(s)
Fixed Versions:
1.1.36
Product / Package Ecosystem Affected Versions Fixed Version
pptagent
PyPI
< 1.1.36
1.1.36

References

Frequently Asked Questions

What is CVE-2026-42078?
CVE-2026-42078 is a security vulnerability in PPTAgent involving Arbitrary File Write + Directory Creation via markdown_table_to_image under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which PPTAgent versions are affected?
Affected versions include releases prior to 1.1.36 across affected packages: pptagent.
What version fixes CVE-2026-42078?
Upgrading to 1.1.36 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pptagent affected?
Yes, pptagent is affected in releases prior to 1.1.36. Upgrade your dependency to 1.1.36 or later.
What is the CVSS score of CVE-2026-42078?
CVE-2026-42078 has a CVSS v3.1 base score of 4.6 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2026-42078?
CVE-2026-42078 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for CVE-2026-42078?
Run the dependency tree command: 'pip show pptagent'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hrcw-xc63-g29m",
  "modified" : "2026-05-05T18:55:50Z",
  "published" : "2026-05-05T18:55:50Z",
  "aliases" : [ "CVE-2026-42078" ],
  "summary" : "PPTAgent: Arbitrary File Write + Directory Creation via markdown_table_to_image",
  "details" : "### Summary\n\nThe `markdown_table_to_image` tool accepts a caller-controlled path parameter and passes it directly to `get_html_table_image`:\n\n```python\n# pptagent/mcp_server.py:127-143\ndef markdown_table_to_image(markdown_table: str, path: str, css: str) -> str:\n    \"\"\"\n    Args:\n        path (str): The file path where the image will be saved\n    \"\"\"\n    html = markdown_to_html(markdown_table)\n    get_html_table_image(html, path, css)           # ← no path validation\n    return f\"Markdown table converted to image and saved to {path}\"\n\n# pptagent/utils.py:337-366\ndef get_html_table_image(html: str, output_path: str, css: str = None):\n    parent_dir, base_name = os.path.split(output_path)\n    if parent_dir and not os.path.exists(parent_dir):\n        os.makedirs(parent_dir)                     # ← creates arbitrary directories\n    hti = Html2Image(...)\n    hti.screenshot(\n        html_str=html,\n        css_str=css,\n        save_as=base_name,                          # ← writes image to any directory\n        size=(1000, 600),\n    )\n```\n\n`os.makedirs(parent_dir)` creates arbitrary directory trees, and `Html2Image.screenshot` writes the rendered image to `parent_dir/base_name`. Unlike `download_file` in the same project, there is no `is_relative_to(workspace)` guard. This behaviour can be fixed with the same pattern as the above.\n\n\n### Impact\n\nThe concrete attack scenarios include\n\n- SSH key replacement: `path = \"/home/user/.ssh/authorized_keys\"` — replaces the authorized_keys file with an image binary (breaks - SSH but could be an image crafted with a specific PNG/JPEG payload).\n- Web shell: `path = \"/var/www/html/uploads/shell.php\"` — writes the rendered PNG there; the file has the .php extension but PNG content; combined with Apache Options +MultiViews or file-include vulnerabilities could be dangerous.\n- Directory creation oracle: `path = \"/root/test/probe.png\"` — if the directory is created, confirms the target path exists; if it errors, reveals permissions information.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pptagent"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.36"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/icip-cas/PPTAgent/security/advisories/GHSA-hrcw-xc63-g29m"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42078"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/icip-cas/PPTAgent/commit/418491a9a1c02d9d93194b5973bb58df35cf9d00"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/icip-cas/PPTAgent"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-05T18:55:50Z",
    "nvd_published_at" : "2026-05-04T17:16:24Z"
  }
}