/

CVE-2026-126042

Severity:

HIGH RISK

(7.0)

OS Command Injection (CWE-78) in VNote Tasks Feature

CVE-2026-126042

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary command execution in the context of the VNote user

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

VNote's Tasks feature can place note filenames or selected text into a shell command without escaping them. If a victim runs a task that references these values in a shared notebook, crafted content may cause commands to execute with the victim's privileges.

Affected context

The issue affects VNote versions before 4.12.0 when Tasks use magic variables such as ${bufferName} or ${selectedText} in shell command strings. Risk arises when a notebook contains a filename or note text controlled by another party and the victim runs a task that references the affected variable.

Exploit preconditions

  • Attack surface: VNote Tasks that construct or invoke shell commands
  • Required access: The attacker must be able to provide or share a notebook with crafted filename or note content; the victim must have access to it
  • Trigger point: The victim runs a task that references the affected magic variable
  • Why exploitation is possible: Variable values are substituted into a shell command string without adequate escaping, allowing shell syntax in the content to be interpreted

Why this happens

The underlying issue is that externally influenced values are interpolated into a command string that is interpreted by a shell. This is an OS command injection flaw, mapped to CWE-78: Improper Neutralization of Special Elements used in an OS Command. The insecure pattern is treating filenames or note content as trusted command syntax rather than data.

Potential impact

  • Commands may execute with the privileges of the VNote user
  • An attacker could potentially access, alter, or delete data available to that user
  • User settings or other accessible files could be modified
  • The compromise could affect other resources accessible from the user's environment

General mitigation guidance

Defensive patterns focus on keeping untrusted content out of shell-interpreted command strings:

  • Prefer APIs that invoke programs with separate arguments and do not start a shell
  • Treat filenames, note text, and other variable values as untrusted input
  • Where shell use cannot be avoided, apply context-appropriate escaping and strict input validation
  • Limit task capabilities and run the application with only the privileges it needs
  • Consider secure-by-default task designs that avoid interpolating note content into commands

How teams detect issues like this

  • Use static analysis to identify shell invocation APIs and command strings containing interpolated variables
  • Review Tasks code for paths where filenames or note content flow into command execution
  • Add policy checks that discourage shell-based process invocation or require explicit review
  • Test task behavior with untrusted notebook content in a controlled environment
  • Automated code review tools may help identify command construction patterns for further assessment

Sources

SourceLink
github.comgithub.com/vnotex/vnote/blob/551dfd86b73ce6d93e5403296b069219cb668dc2/src/core/services/shellexecution.cpp#L50-L56
github.comgithub.com/vnotex/vnote/blob/551dfd86b73ce6d93e5403296b069219cb668dc2/src/core/services/shellexecution.cpp#L8-L24
github.comgithub.com/vnotex/vnote/commit/0f5edd837d233a929d2a514a0e718d5d19c93918
github.comgithub.com/vnotex/vnote/releases/tag/v4.12.0
r3vpwnx.spacer3vpwnx.space/research/vnote-tasks-cmdinjection/
vulncheck.comvulncheck.com/advisories/vnote-3.11.0-before-4.12.0-os-command-injection-via-tasks-magic-variables

Frequently asked

questions

The described trigger requires a victim to run a task using a notebook containing attacker-controlled content. Sharing a notebook can provide that content, but execution depends on the victim's action.

The attacker needs a way to supply or share a notebook whose filename or text is used by a task. The victim must run a task that references the affected variable.

Avoid building shell command strings from variable content. Prefer process APIs that pass arguments separately and do not invoke a shell.

Treat file and note content as untrusted, review data flows into process execution, and enforce policies that restrict shell invocation and excessive privileges.

Find out what's already
exploitable in your codebase.