/

CVE-2026-73032

Severity:

CRITICAL RISK

(9.6)

Code Injection (CWE-94) in PapersGPT Zotero Extension

CVE-2026-73032

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution in a Privileged Application Context

Severity:

CRITICAL RISK

(9.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

PapersGPT for Zotero may execute attacker-controlled JavaScript when output from an LLM endpoint is passed unsanitized to window.eval(). If malicious content reaches that endpoint response through prompt injection, request interception, or a hostile custom service, code could run with Zotero's chrome-privileged access.

Affected context

The vulnerability occurs in PapersGPT for Zotero deployments that process LLM responses and evaluate returned content as JavaScript. Risk increases when PDFs or other inputs can influence prompts, API traffic can be intercepted or modified, or users can configure an untrusted custom LLM endpoint. Because the evaluation occurs in Zotero's privileged context, the resulting access may extend beyond ordinary web content restrictions.

Exploit preconditions

  • Attack surface: LLM response handling within the PapersGPT Zotero extension
  • Required access: Ability to influence the content returned by the configured LLM service, directly or indirectly
  • Trigger point: Processing an LLM response that reaches the JavaScript evaluation path
  • Why exploitation is possible: Response data is treated as executable JavaScript without sufficient sanitization, isolation, or trust validation

Why this happens

The underlying flaw is a code injection condition caused by evaluating externally influenced text through window.eval(). LLM output is data that may contain adversarial or manipulated content, but the application treats it as executable program logic. This behavior maps to CWE-94: Improper Control of Generation of Code, because an insufficiently controlled input-to-code boundary permits attacker-influenced JavaScript execution.

Potential impact

  • Arbitrary JavaScript execution in the Zotero chrome-privileged context
  • Reading, modifying, or deleting local files accessible to Zotero
  • Process execution through available privileged application interfaces
  • Exposure or manipulation of Zotero libraries, notes, attachments, and settings
  • Possible persistence, data theft, or compromise of the user's workstation

General mitigation guidance

Mitigation generally focuses on eliminating dynamic evaluation of LLM output and reducing trust in model-generated content.

Common defensive patterns include:

  • Treating all LLM responses as untrusted data rather than executable code
  • Removing eval() and equivalent dynamic code-generation paths
  • Using narrowly scoped, typed commands or structured data with strict schema validation when automation is required
  • Isolating content processing from chrome-privileged APIs and applying least-privilege capability boundaries
  • Authenticating and protecting LLM connections against interception or endpoint substitution
  • Restricting custom endpoint configuration and clearly separating trusted instructions from document content
  • Requiring explicit user approval for sensitive file, process, or data operations

How teams detect issues like this

Detection can combine static analysis, code review, and runtime policy controls:

  • Search source code and dependencies for eval(), Function constructors, dynamic script injection, and equivalent code-generation APIs
  • Review data flows from LLM responses, document text, network requests, and custom endpoint settings into executable sinks
  • Flag privileged extension code that evaluates remotely influenced strings or exposes broad filesystem and process capabilities
  • Enforce repository policies that prohibit dynamic evaluation of network- or model-derived content
  • Add tests that verify adversarial or malformed LLM output remains inert and is handled only as structured data
  • Use automated security review tools to identify untrusted-input-to-code-execution paths

Sources

SourceLink
github.comgithub.com/papersgpt/papersgpt-for-zotero
github.comgithub.com/papersgpt/papersgpt-for-zotero/commit/094134172ce4a344a31e4b196cc75d1806383658
github.comgithub.com/papersgpt/papersgpt-for-zotero/issues/154
github.comgithub.com/papersgpt/papersgpt-for-zotero/pull/155
vulncheck.comvulncheck.com/advisories/papersgpt-for-zotero-rce-via-unsanitized-llm-response-eval

Frequently asked

questions

It may be exploitable through remotely influenced LLM responses, but successful exploitation depends on the extension processing the response and on an attacker controlling or manipulating an upstream input, network path, or configured endpoint.

An attacker generally needs a way to influence the LLM output, such as through malicious document content, interception of an inadequately protected request, or control of a custom LLM service. Local access to the Zotero profile is not necessarily required.

The safest pattern is to ensure that LLM output is never evaluated as JavaScript. If actions are necessary, use a constrained, validated data format and execute only explicitly allowlisted operations outside the privileged context.

Apply strict trust boundaries to model output, protect endpoint communication and configuration, minimize extension privileges, review all dynamic execution sinks, and test document- and prompt-influenced inputs as untrusted data.

Find out what's already
exploitable in your codebase.