CVE-2026-138299 in CherryTreeinfo

Summary

by MITRE • 11/28/2026

CherryTree through 1.7.3 contains a LaTeX rendering filter bypass vulnerability in _is_latex_text_safe() that allows attackers to read local files by building blocked command names with TeX macro expansion. Attackers can craft a document with a LaTeX node using \csname verbatiminput\endcsname to render user-readable files into the embedded note image when opened.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/28/2026

The vulnerability identified in CherryTree versions through 1.7.3 represents a critical security flaw within its LaTeX rendering engine, specifically located in the _is_latex_text_safe() function which is designed to sanitize input before processing. This application serves as an open-source hierarchical note-taking tool that supports rich text formatting and embedded media, including the ability to render mathematical expressions and code snippets using LaTeX. The core issue arises from a failure in the validation logic when handling TeX macro expansions, allowing attackers to bypass intended security restrictions through indirect command construction techniques rather than direct invocation of dangerous commands.

The technical mechanism behind this exploitation relies on the dynamic nature of TeX macros, particularly the \csname...\endcsname construct which allows for the programmatic creation of control sequence names at runtime. By utilizing this feature, an attacker can bypass static string matching filters that typically block known dangerous LaTeX commands such as verbatiminput or input. Instead of directly writing these prohibited keywords in the document source, the malicious actor constructs them dynamically during the parsing phase. This evasion technique effectively neutralizes signature-based defenses embedded within the application's sanitization layer because the final command name is not present in its raw form until after the security check has already been performed and passed.

The operational impact of this vulnerability is severe as it enables arbitrary local file read access on the victim's system. When a user opens a crafted CherryTree document containing the malicious LaTeX node, the application processes the input through its rendering pipeline. The bypassed command executes within the context of the running process, which typically has permissions to read files from the local filesystem where the user operates. Consequently, sensitive documents, configuration files, or other private data stored on the disk can be extracted and rendered into embedded images within the note itself. This constitutes a significant privacy breach and potential vector for further exploitation depending on the sensitivity of the accessible data.

From a classification perspective, this vulnerability aligns with CWE-78 Improper Neutralization of Special Elements used in an OS Command, specifically relating to command injection via indirect method invocation. It also reflects weaknesses associated with CWE-20 Improper Input Validation where the sanitization logic fails to account for dynamic code generation techniques common in scripting and markup languages like TeX. In terms of adversary behavior, this aligns with ATT&CK technique T1564.003 Hidden Files and Directories or more broadly T1083 File and Directory Discovery if used for reconnaissance, though the primary impact here is data exfiltration via local file read capabilities often categorized under initial access or collection phases depending on deployment context.

Mitigation strategies must focus on both immediate remediation and long-term architectural improvements to input validation processes. The most effective solution is to upgrade CherryTree to a version later than 1.7.3 where the _is_latex_text_safe() function has been patched to properly handle macro expansion contexts or to disable LaTeX rendering entirely if not required by the user base. For organizations deploying this software, implementing application whitelisting can restrict the execution of untrusted scripts and binaries launched by the application sandbox. Additionally, users should be educated on the risks of opening documents from untrusted sources, as social engineering remains a primary vector for delivering such crafted files. Future development efforts should prioritize adopting allow-listing approaches for permitted LaTeX commands rather than relying solely on deny-lists which are inherently vulnerable to obfuscation and indirect invocation techniques like those demonstrated here.

Responsible

VulnCheck

Reservation

11/28/2026

Disclosure

11/28/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!