CherryTree Patched for LaTeX Filter Bypass Allowing Local File Read

2 min read
Source: CVEs | Zero Wire | Cloudflare Radar
CherryTree Patched for LaTeX Filter Bypass Allowing Local File Read
Photo: CVEs | Zero Wire | Cloudflare Radar
TL;DR

CherryTree, a hierarchical note-taking application, has been patched to address CVE-2026-138299, a medium-severity vulnerability that allowed attackers to read local files by bypassing LaTeX rendering filters. The flaw, present in versions up to 1.7.3, exploited TeX macro expansion to construct blocked command names, enabling unauthorized data access when users opened crafted documents.

Key points

  • CVE-2026-138299 affects CherryTree versions up to and including 1.7.3, with a CVSS 4.0 score of 5.7 (Medium) and a secondary CVSS 3.1 score of 4.7 (Medium).
  • The vulnerability stems from an incomplete denylist in the _is_latex_text_safe() function, which failed to block TeX macro expansion primitives like \csname and \endcsname.
  • Attackers could craft documents using \csname verbatiminput\endcsname to render local files into embedded note images, requiring local access and user interaction to exploit.
  • The fix, committed in version 1.7.3's development branch, expanded the regex filter to block macro expansion and file I/O primitives, and renamed the function to isLatexTextSafe.
  • The vulnerability was originally reported in April 2026, with an initial patch in April 2026 that was insufficient, leading to the final fix that addresses the residual bypass.

Background

CherryTree is a note-taking application developed by Giuseppe Penone and Evgenii Gurianov, featuring LaTeX math rendering and data storage in XML or SQLite. The latest stable release, version 1.7.3, was released on November 7, 2026. The vulnerability was first reported in April 2026, with an initial patch that was later found to be insufficient due to TeX macro expansion bypasses. Recent cybersecurity disclosures, such as FFmpeg 9.1 and Pydantic AI flaws, highlight ongoing efforts to address medium-severity vulnerabilities in software.

Why it matters

The vulnerability allows attackers to read local files, potentially exposing sensitive data, and underscores the importance of robust input validation in software that processes user-generated content. The incomplete denylist in CherryTree's LaTeX filter highlights the risks of relying on blocklists for security, as attackers can bypass them using macro expansion techniques.

What to watch

Users of CherryTree should update to the latest version to ensure they have the patched code that addresses CVE-2026-138299. Developers should review their input validation mechanisms to ensure they account for macro expansion and other bypass techniques. Security researchers may continue to analyze the vulnerability to identify potential variations or related issues.

Share this article

Want the full story? Read the original reporting

Read on CVEs | Zero Wire | Cloudflare Radar