Skip to main content
Vulnerability Database/CVE-2026-107734

CVE-2026-107734: SumatraPDF RCE Vulnerability

CVE-2026-107734 is a remote code execution vulnerability in SumatraPDF that allows command injection through crafted SyncTeX files. This article covers the technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-107734 Overview

CVE-2026-107734 is an argument injection vulnerability in SumatraPDF, a multi-format document reader for Windows. Versions 3.5.2 and earlier substitute an attacker-controlled SyncTeX source filename into the %f placeholder of an external editor command line. The reader passes the resulting string to CreateProcessW() without applying safe Windows argument quoting. A user who has an external editor configured or auto-detected can trigger the flaw by opening a PDF accompanied by a crafted .synctex.gz file and invoking inverse search. The vulnerability maps to improper input validation [CWE-20].

Critical Impact

Attackers can inject command-line flags into the configured editor process, enabling unintended editor actions or code execution through a malicious editor extension.

Affected Products

  • SumatraPDF 3.5.2 and earlier (Windows)
  • Installations with an external editor configured for SyncTeX inverse search
  • Installations where SumatraPDF auto-detects a compatible external editor

Discovery Timeline

  • 2026-10-08 - CVE-2026-107734 published to NVD
  • 2026-10-09 - Last updated in NVD database

Technical Details for CVE-2026-107734

Vulnerability Analysis

SumatraPDF supports SyncTeX inverse search, which lets users jump from a position in a rendered PDF back to the originating .tex source in an external editor. The reader reads the source filename from the .synctex.gz file bundled with the PDF, substitutes it for the %f token in the editor command template, and launches the editor through CreateProcessW(). Because CreateProcessW() accepts a single command-line string that the target process parses itself, any unescaped quote or whitespace in the filename changes argument boundaries. A filename such as foo.tex" --install-extension evil.vsix -- closes the template's surrounding quotes and injects additional flags for the editor to interpret.

Root Cause

The root cause is missing input validation and argument sanitization in SyncTex::DocToSource and the %f substitution path in BuildOpenFileCmdTemp. SumatraPDF trusted the SyncTeX source name verbatim and did not reject characters that cannot appear in valid Windows paths or double any embedded quote characters before concatenating the string into the editor command line.

Attack Vector

Exploitation requires local user interaction. An attacker delivers a PDF together with a crafted .synctex.gz file whose source filename contains injected editor flags. When the victim opens the PDF in SumatraPDF and invokes inverse search, the configured editor executes with the attacker-supplied flags. Impact depends on the editor: flags such as --install-extension on VS Code can load a malicious extension and achieve code execution in the user context.

cpp
// Patch in src/PdfSync.cpp - reject illegal characters in SyncTeX source names
return PDFSYNCERR_UNKNOWN_SOURCEFILE;
}

// The name comes verbatim from the .synctex file, which travels with the PDF
// and is entirely attacker-controlled. It ends up on the command line of the
// configured inverse-search editor (BuildOpenFileCmdTemp), so a name like
//   foo.tex" --install-extension evil.vsix --
// breaks out of the editor template's quotes and injects arguments
// (GHSA-jf4v-rw66-j4w2). None of these characters can occur in a real
// Windows path, so a name that has one is not a source file we should act
// on. A '*' is legitimate here - SyncTeX encodes spaces as '*'.
if (str::ContainsCharAny(name, StrL("\"<>|\r\n\t"))) {
    logf("SyncTex::DocToSource: rejecting source name with an illegal char: '%s'\n", name);
    return PDFSYNCERR_UNKNOWN_SOURCEFILE;
}

filename = str::Dup(name);

Source: GitHub commit 398d236

cpp
// Patch in src/SearchAndDDE.cpp - defense in depth: double embedded quotes in %f substitution
char spec = s.s[percIdx + 1];
if (spec == 'f') {
    // Defense in depth against argument injection via a crafted synctex
    // source name (GHSA-jf4v-rw66-j4w2). Every built-in editor template
    // wraps %f in quotes, so a '"' in the path would close that quote and
    // turn the rest into separate argv tokens for the editor. Double each
    // '"' so it stays one token. The primary fix rejects such names in
    // SyncTex::DocToSource; this covers other callers and user templates.
    if (str::ContainsChar(path, '"')) {
        cmdline.Append(str::ReplaceTemp(path, StrL("\""), StrL("\"\"")));
    } else {
        cmdline.Append(path);
    }
} else if (spec == 'l') {
    cmdline.Append(fmt("%d", line));
}

Source: GitHub commit 398d236

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-107734

Indicators of Compromise

  • .synctex.gz files whose decompressed Input records contain characters such as ", <, >, |, carriage return, newline, or tab in the source filename field.
  • SumatraPDF spawning an external editor process (for example code.exe, notepad++.exe, subl.exe) with unusual command-line flags such as --install-extension, --extensionDevelopmentPath, or shell redirection tokens.
  • Creation of unexpected editor extension files or configuration changes shortly after a PDF is opened by SumatraPDF.exe.

Detection Strategies

  • Hunt for process creation events where the parent is SumatraPDF.exe and the child command line contains argument separators or quote characters not present in the configured editor template.
  • Inspect .synctex.gz artifacts delivered alongside PDFs from email or external sources for suspicious source filenames that are not valid Windows paths.
  • Correlate SumatraPDF launches with subsequent writes to editor extension directories such as %USERPROFILE%\.vscode\extensions\.

Monitoring Recommendations

  • Enable Windows process-creation auditing (Event ID 4688 with command-line logging) on endpoints that use SumatraPDF with SyncTeX.
  • Forward endpoint telemetry to a centralized data lake and alert on SumatraPDF.exe parent processes spawning editors with unexpected flags.
  • Track installation of new VS Code or similar editor extensions on developer and TeX-authoring workstations.

How to Mitigate CVE-2026-107734

Immediate Actions Required

  • Avoid opening untrusted PDFs in SumatraPDF, especially those delivered with accompanying .synctex.gz files from unknown sources.
  • Disable or clear the configured inverse-search external editor in SumatraPDF settings until a fixed build is available.
  • Restrict developer workstations from auto-detecting unverified editors as the SyncTeX inverse-search target.

Patch Information

No fixed release of SumatraPDF is available as of this review. The upstream fix is tracked in GitHub Security Advisory GHSA-jf4v-rw66-j4w2 and implemented in commit 398d236, which rejects illegal characters in SyncTeX source names and doubles embedded quotes during %f substitution. Users building from source should apply this commit or a later revision.

Workarounds

  • Remove the external editor entry from SumatraPDF's inverse-search configuration to prevent %f substitution and process launch.
  • Use SumatraPDF only against PDFs and .synctex.gz files produced locally from trusted TeX sources.
  • Block delivery of .synctex.gz attachments through email gateways or web filtering where SyncTeX workflows are not required.
bash
# Example: inspect a .synctex.gz for suspicious source filenames before opening the PDF
gunzip -c suspicious.synctex.gz | grep -E '^Input:' | grep -E '["<>|]|\\t|\\r|\\n'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.