/

CVE-2026-118692

Severity:

HIGH RISK

(7.0)

OS Command Injection (CWE-78) in CherryTree Link Handlers

CVE-2026-118692

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution

Severity:

HIGH RISK

(7.0)

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

CherryTree through version 1.7.2 contains an OS command injection vulnerability in the link-click handling logic. When the non-default Custom Web Link Clicked Action option is enabled, a victim who opens a crafted document and clicks a malicious web link may execute attacker-controlled commands with the victim's privileges.

CherryTree through version 1.7.2 contains an OS command injection vulnerability in the link-click handling logic. When the non-default Custom Web Link Clicked Action option is enabled, a victim who opens a crafted document and clicks a malicious web link may execute attacker-controlled commands with the victim's privileges.

Affected context

The vulnerability occurs in CherryTree's CtActions::link_clicked handler when the Custom Web Link Clicked Action setting is enabled. Risk is present when documents containing attacker-controlled links can be opened by a user and those links are passed to a shell through std::system without adequate argument isolation.

The vulnerability occurs in CherryTree's CtActions::link_clicked handler when the Custom Web Link Clicked Action setting is enabled. Risk is present when documents containing attacker-controlled links can be opened by a user and those links are passed to a shell through std::system without adequate argument isolation.

Exploit preconditions

  • Attack surface: CherryTree document link handling
  • Required access: The attacker must be able to provide or influence a CherryTree document containing a crafted web link.
  • Trigger point: The victim clicks the link while the non-default Custom Web Link Clicked Action option is enabled.
  • Why exploitation is possible: Link content is incorporated into a command and passed unquoted to std::system, allowing shell metacharacters to alter command interpretation.
  • Attack surface: CherryTree document link handling
  • Required access: The attacker must be able to provide or influence a CherryTree document containing a crafted web link.
  • Trigger point: The victim clicks the link while the non-default Custom Web Link Clicked Action option is enabled.
  • Why exploitation is possible: Link content is incorporated into a command and passed unquoted to std::system, allowing shell metacharacters to alter command interpretation.

Why this happens

The underlying flaw is the construction of an operating-system command from link data that is not treated as untrusted input. Passing that data to std::system without strict validation, safe argument handling, or shell avoidance allows shell metacharacters to be interpreted as control syntax. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command.

The underlying flaw is the construction of an operating-system command from link data that is not treated as untrusted input. Passing that data to std::system without strict validation, safe argument handling, or shell avoidance allows shell metacharacters to be interpreted as control syntax. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command.

Potential impact

  • An attacker may execute arbitrary commands with the victim's operating-system privileges.
  • Sensitive local files or credentials could be accessed or modified.
  • The application or user workspace could be compromised.
  • Malware or persistence mechanisms could be installed, depending on available privileges.
  • The affected host could be used as a foothold for further activity.
  • An attacker may execute arbitrary commands with the victim's operating-system privileges.
  • Sensitive local files or credentials could be accessed or modified.
  • The application or user workspace could be compromised.
  • Malware or persistence mechanisms could be installed, depending on available privileges.
  • The affected host could be used as a foothold for further activity.

General mitigation guidance

Mitigation generally focuses on removing shell interpretation from link actions and reducing trust in document-provided URLs.

Common defensive patterns include:

  • Prefer direct process or API invocation with structured arguments instead of shell-based execution.
  • Permit only explicitly supported URL schemes, destinations, and action formats.
  • Treat document links as untrusted input and apply strict parsing and allowlisting before any action.
  • Keep custom command execution disabled by default unless there is a justified operational need.
  • Run the application with least-privilege user permissions and limit access to sensitive resources.
  • Provide user confirmation and clear context before invoking external applications or commands.

Mitigation generally focuses on removing shell interpretation from link actions and reducing trust in document-provided URLs.

Common defensive patterns include:

  • Prefer direct process or API invocation with structured arguments instead of shell-based execution.
  • Permit only explicitly supported URL schemes, destinations, and action formats.
  • Treat document links as untrusted input and apply strict parsing and allowlisting before any action.
  • Keep custom command execution disabled by default unless there is a justified operational need.
  • Run the application with least-privilege user permissions and limit access to sensitive resources.
  • Provide user confirmation and clear context before invoking external applications or commands.

How teams detect issues like this

Organizations can identify related risks through:

  • Static analysis searches for system, shell-spawning APIs, and command construction involving URLs or document content.
  • Code review checks for unquoted or concatenated user-controlled values in process commands.
  • Tests using metacharacter-containing inputs to verify that link handlers do not invoke shell syntax.
  • Policy enforcement that restricts custom command actions and permits only approved URL schemes.
  • Runtime monitoring for unexpected child processes launched by the application.

Automated security review tools may help flag shell invocation and insufficient input validation, but findings should be confirmed against the application's execution flow.

Organizations can identify related risks through:

  • Static analysis searches for system, shell-spawning APIs, and command construction involving URLs or document content.
  • Code review checks for unquoted or concatenated user-controlled values in process commands.
  • Tests using metacharacter-containing inputs to verify that link handlers do not invoke shell syntax.
  • Policy enforcement that restricts custom command actions and permits only approved URL schemes.
  • Runtime monitoring for unexpected child processes launched by the application.

Automated security review tools may help flag shell invocation and insufficient input validation, but findings should be confirmed against the application's execution flow.

Sources

SourceLink
github.comgithub.com/giuspen/cherrytree
github.comgithub.com/giuspen/cherrytree/blob/v1.7.2/src/ct/ct_actions_others.cc#L381-L388
github.comgithub.com/giuspen/cherrytree/blob/v1.7.2/src/ct/ct_misc_utils.cc#L227-L247
github.comgithub.com/giuspen/cherrytree/issues/2945
vulncheck.comvulncheck.com/advisories/cherrytree-through-1.7.2-os-command-injection-via-custom-web-link-action

Frequently asked

questions

It is primarily triggered through a crafted document or link delivered to the victim. It may be remotely originated if an attacker can distribute such a document, but exploitation requires the victim to open the document and click the link under the affected configuration.

The attacker generally needs a way to provide or influence a CherryTree document containing a malicious link. The victim must have the non-default Custom Web Link Clicked Action option enabled and interact with the link.

Avoid passing link data to a shell. Use structured process-launch APIs, strict URL and action allowlists, and safe argument handling whenever external applications must be invoked.

Keep custom command features disabled by default, treat document content as untrusted, review shell-invocation paths, apply least privilege, and test link handlers with hostile input patterns.

It is primarily triggered through a crafted document or link delivered to the victim. It may be remotely originated if an attacker can distribute such a document, but exploitation requires the victim to open the document and click the link under the affected configuration.

The attacker generally needs a way to provide or influence a CherryTree document containing a malicious link. The victim must have the non-default Custom Web Link Clicked Action option enabled and interact with the link.

Avoid passing link data to a shell. Use structured process-launch APIs, strict URL and action allowlists, and safe argument handling whenever external applications must be invoked.

Keep custom command features disabled by default, treat document content as untrusted, review shell-invocation paths, apply least privilege, and test link handlers with hostile input patterns.

Find out what's already
exploitable in your codebase.