/

CVE-2026-42079

Severity:

HIGH RISK

(8.6)

Code Injection in PPTAgent LLM-Generated PowerPoint

CVE-2026-42079

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-95

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(8.6)

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

PPTAgent, an agentic framework for reflective PowerPoint generation, previously executed LLM-generated Python code using eval() with full builtins in scope.

Under these conditions, an attacker who can influence the model output or prompt stream may achieve arbitrary code execution on the host system.

Affected context

This vulnerability arises in PPTAgent deployments that rely on dynamically executing Python code generated by a large language model to drive slide creation and automation flows.

The risk materializes when model outputs are evaluated directly with eval() in an environment where Python builtins and other sensitive objects are accessible, and where prompts, tools, or connectors can be influenced by users, plugins, or upstream systems.

Any setup that treats LLM output as trusted executable logic, without applying strict sandboxing or transformation to a non-executable format, is particularly exposed.

Exploit preconditions

  • Attack surface: The interfaces through which the LLM receives instructions or context, such as user prompts, API calls, tool outputs, or integrated workflow steps that shape the generated code.
  • Required access: Ability to directly or indirectly influence the text that the LLM turns into Python code (e.g., end-user prompts, compromised upstream systems, or prompt injection via external documents, web content, or plugins).
  • Trigger point: The moment PPTAgent invokes eval() on the LLM-generated Python code while builtins remain in scope and the result is executed as part of the automation pipeline.
  • Why exploitation is possible: eval() evaluates arbitrary Python expressions in the current execution context; with builtins exposed, an attacker-controlled expression can import modules, interact with the filesystem, spawn processes, or access network and environment data, leading to code execution.

Why this happens

The underlying issue maps to CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection').

PPTAgent treated LLM-generated Python code as trusted and executed it using eval() in an environment where powerful capabilities were available through builtins and standard library imports.

No strict isolation, whitelisting, or transformation to a constrained domain-specific language was applied, so untrusted, text-based instructions could directly become executable Python.

Conceptually, this pattern confuses data with code: natural-language instructions and generated snippets are given full interpreter privileges instead of being constrained to declarative, non-executable formats.

Potential impact

  • Arbitrary file read and write operations on the host running PPTAgent.
  • Execution of OS-level commands and spawning of subprocesses, which may lead to full system compromise.
  • Exfiltration of sensitive information, such as environment variables, access tokens, or configuration secrets reachable from the process.
  • Abuse of network access to pivot inside the environment, call internal services, or participate in broader supply-chain attacks.
  • Tampering with generated presentations, embedding malicious content, or altering downstream workflows that trust PPTAgent output.

General mitigation guidance

Effective mitigation focuses on eliminating direct execution of untrusted, model-generated code and reducing the authority of any execution environment:

  • Replace eval() and similar dynamic execution primitives (exec, ast.literal_eval misuses, runpy, etc.) with structured, declarative interfaces that interpret LLM output as data, not code (e.g., JSON specifications of actions or slide structures).
  • Introduce a constrained command or template language where the agent is limited to a small, audited set of operations, instead of arbitrary Python expressions.
  • If some form of execution is unavoidable, isolate it in a sandbox with strict capability controls (e.g., restricted interpreters, containers with minimal privileges, disabled network, read-only file system zones).
  • Remove or heavily restrict access to Python builtins and dangerous standard library modules from any evaluation environment exposed to LLM-generated content.
  • Apply least-privilege principles to the PPTAgent runtime: ensure it runs with minimal OS permissions, restricted filesystem access, and only the network capabilities strictly needed.

How teams detect issues like this

Detection in this class of vulnerabilities typically combines code-level inspection with policy-based guardrails:

  • Use static analysis or grep-based checks to locate uses of eval(), exec(), dynamic imports, or similar dynamic execution APIs, especially where arguments derive from LLM outputs, user prompts, or other untrusted inputs.
  • During code review, treat any pattern that converts natural language or serialized content directly into executable Python as a high-risk smell, and require justification plus sandboxing or refactoring to declarative protocols.
  • Enforce secure coding policies that prohibit eval() in production code, or restrict it behind well-documented, reviewed wrappers that enforce whitelists and isolation.
  • Integrate automated review tools in CI pipelines to detect the introduction or reintroduction of dynamic evaluation patterns and flag them for security review.
  • Monitor runtime logs for unexpected errors, stack traces, or anomalous behavior originating from dynamically evaluated code segments, which may indicate attempted or successful exploitation.

Sources

SourceLink
github.comgithub.com/icip-cas/PPTAgent/commit/418491a9a1c02d9d93194b5973bb58df35cf9d00
github.comgithub.com/icip-cas/PPTAgent/security/advisories/GHSA-89g2-xw5c-v95p

Frequently asked

questions

It can be, depending on how PPTAgent is integrated. If remote users, external documents, or third-party systems can influence the prompts or context feeding the LLM, they may be able to cause malicious Python code to be generated and evaluated.

The attacker needs the ability to shape the LLM's code output, typically by controlling prompts, prompt-injected content (such as slides, notes, or URLs the agent reads), or intermediate tool responses. Direct shell or host access is not required if these channels are reachable.

The safest pattern is to remove direct eval() of LLM-generated Python entirely and redesign the system around a constrained, declarative interface: the model outputs structured data describing desired actions, and a trusted, audited executor interprets that data using a fixed set of capabilities.

Treat all LLM outputs as untrusted data, avoid dynamic code execution paths, and design agent frameworks using capability-limited tools and declarative schemas. Reinforce this with coding guidelines that forbid direct eval()/exec() on model output, automated checks in CI, and regular security reviews of any component that turns text into executable logic.

Find out what's already
exploitable in your codebase.