/

CVE-2026-86016

Severity:

HIGH RISK

(8.2)

Stored XSS (CWE-79) in VNote Markdown Note Preview Viewer

CVE-2026-86016

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Local-context script execution and sensitive data disclosure

Severity:

HIGH RISK

(8.2)

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 versions before 4.3.0 may insert attacker-controlled YAML frontmatter into the Markdown preview DOM before sanitization is applied. Opening a malicious note could execute stored JavaScript in the local file viewer and, under permissive local-content settings, expose reachable note files to a remote destination.

VNote versions before 4.3.0 may insert attacker-controlled YAML frontmatter into the Markdown preview DOM before sanitization is applied. Opening a malicious note could execute stored JavaScript in the local file viewer and, under permissive local-content settings, expose reachable note files to a remote destination.

Affected context

The issue can occur in VNote's Markdown rendering flow when YAML frontmatter from a note is placed into a preview element through an HTML-sensitive DOM property before the intended XSS protection path runs. Risk is higher when an attacker can supply or alter a note and a user opens it in the file:// viewer with local content permitted to access remote URLs.

The issue can occur in VNote's Markdown rendering flow when YAML frontmatter from a note is placed into a preview element through an HTML-sensitive DOM property before the intended XSS protection path runs. Risk is higher when an attacker can supply or alter a note and a user opens it in the file:// viewer with local content permitted to access remote URLs.

Exploit preconditions

  • Attack surface: Markdown note rendering and preview in the desktop application
  • Required access: Ability to provide or modify a note that a user may open
  • Trigger point: Opening the attacker-controlled note in the Markdown viewer
  • Why exploitation is possible: Frontmatter is inserted as HTML before sanitization, allowing script content to reach the rendered document; permissive local-content network access may then broaden the impact
  • Attack surface: Markdown note rendering and preview in the desktop application
  • Required access: Ability to provide or modify a note that a user may open
  • Trigger point: Opening the attacker-controlled note in the Markdown viewer
  • Why exploitation is possible: Frontmatter is inserted as HTML before sanitization, allowing script content to reach the rendered document; permissive local-content network access may then broaden the impact

Why this happens

The vulnerability results from assigning untrusted Markdown frontmatter to innerHTML before the sanitization routine is applied. This creates a DOM-based injection path in which data intended to be treated as metadata can be interpreted as active markup or script by the rendering engine. The issue maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.

The vulnerability results from assigning untrusted Markdown frontmatter to innerHTML before the sanitization routine is applied. This creates a DOM-based injection path in which data intended to be treated as metadata can be interpreted as active markup or script by the rendering engine. The issue maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.

Potential impact

  • Arbitrary JavaScript may execute when a malicious note is opened
  • Local note contents may be read if they are reachable from the viewer context
  • Sensitive information could be transmitted to an external server
  • Application state or rendered content could be altered
  • A user could be exposed to follow-on attacks without additional interaction after opening the note
  • Arbitrary JavaScript may execute when a malicious note is opened
  • Local note contents may be read if they are reachable from the viewer context
  • Sensitive information could be transmitted to an external server
  • Application state or rendered content could be altered
  • A user could be exposed to follow-on attacks without additional interaction after opening the note

General mitigation guidance

Mitigation generally focuses on ensuring that note content remains data throughout the rendering pipeline.

Common defensive patterns include:

  • Prefer text-only DOM APIs or trusted templating mechanisms over direct HTML assignment
  • Apply context-appropriate sanitization before any content reaches an HTML-sensitive sink
  • Parse and validate frontmatter separately from rendered Markdown content
  • Disable local-content access to remote URLs unless the feature is strictly required
  • Restrict file and application privileges to reduce the impact of local-context script execution
  • Use a restrictive content security policy and isolate untrusted previews where practical

Mitigation generally focuses on ensuring that note content remains data throughout the rendering pipeline.

Common defensive patterns include:

  • Prefer text-only DOM APIs or trusted templating mechanisms over direct HTML assignment
  • Apply context-appropriate sanitization before any content reaches an HTML-sensitive sink
  • Parse and validate frontmatter separately from rendered Markdown content
  • Disable local-content access to remote URLs unless the feature is strictly required
  • Restrict file and application privileges to reduce the impact of local-context script execution
  • Use a restrictive content security policy and isolate untrusted previews where practical

How teams detect issues like this

Detection approaches can include:

  • Static analysis rules for innerHTML and comparable HTML injection sinks receiving note or frontmatter data
  • Code review checks that verify sanitization occurs before DOM insertion, rather than after it
  • Tests containing benign marker data to confirm that metadata is rendered as text and cannot become executable markup
  • Policy enforcement that limits local file access and remote URL permissions in embedded browser settings
  • Automated code review or security scanning tools that identify untrusted data flows into browser DOM sinks

Detection approaches can include:

  • Static analysis rules for innerHTML and comparable HTML injection sinks receiving note or frontmatter data
  • Code review checks that verify sanitization occurs before DOM insertion, rather than after it
  • Tests containing benign marker data to confirm that metadata is rendered as text and cannot become executable markup
  • Policy enforcement that limits local file access and remote URL permissions in embedded browser settings
  • Automated code review or security scanning tools that identify untrusted data flows into browser DOM sinks

Sources

SourceLink
github.comgithub.com/vnotex/vnote/commit/7371efde531312eb24beb982fb5fdd73469cb171
github.comgithub.com/vnotex/vnote/releases/tag/v4.3.0
github.comgithub.com/vnotex/vnote/security/advisories/GHSA-vfhj-c636-h59x

Frequently asked

questions

Exploitation generally requires a malicious note to reach the VNote installation and be opened by a user. The resulting script execution occurs locally, while permissive viewer settings may allow interaction with remote services.

An attacker needs a way to provide or modify a Markdown note that the target user will open. Direct access to the victim's device is not necessarily required if notes are obtained through a shared, synchronized, or otherwise untrusted source.

Treat frontmatter and note content as untrusted data, render metadata through text-safe APIs, and ensure sanitization occurs before any HTML-sensitive insertion. Restrict local-content network access when it is not essential.

Use secure DOM coding standards, enforce trusted-types or equivalent policies where available, review data flows into rendering sinks, and test previews with adversarial content under least-privilege browser settings.

Exploitation generally requires a malicious note to reach the VNote installation and be opened by a user. The resulting script execution occurs locally, while permissive viewer settings may allow interaction with remote services.

An attacker needs a way to provide or modify a Markdown note that the target user will open. Direct access to the victim's device is not necessarily required if notes are obtained through a shared, synchronized, or otherwise untrusted source.

Treat frontmatter and note content as untrusted data, render metadata through text-safe APIs, and ensure sanitization occurs before any HTML-sensitive insertion. Restrict local-content network access when it is not essential.

Use secure DOM coding standards, enforce trusted-types or equivalent policies where available, review data flows into rendering sinks, and test previews with adversarial content under least-privilege browser settings.

Find out what's already
exploitable in your codebase.