Skip to content

Markdown XSS leads to RCE

High
tamlok published GHSA-w655-h68w-vxxc Jul 24, 2024

Package

No package listed

Affected versions

<=3.18.1

Patched versions

>3.18.1

Description

Markdown XSS leads to RCE in VNote version <=3.18.1

Severity : High (8.6)

CVSS score : CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

Summary :

A Cross-Site Scripting (XSS) vulnerability was identified in the Markdown rendering functionality of the VNote note-taking application. This vulnerability allows the injection and execution of arbitrary JavaScript code, potentially leading to Remote Code Execution (RCE).

Steps to Reproduce :

  1. Create a note in Vnote.
  2. Enter the following JS payload in the app,
<img src="" onerror="alert('XSS') alt="alt text">
  1. Press CTRL+T to render the markdown content.
  2. Observe the JavaScript payload executing an alert popup.

image

There is no whitelisting or output encoding performed for the given payload, resulting in an XSS vulnerability.

NOTE: The application properly validates some JavaScript payloads by performing output encoding in the app. However, it fails to validate in certain cases.

image

image

  1. Further an attacker can achieve Remote Code execution using the following payload.
<iframe src="../../../../../../../../Windows/System32/cmd.exe"  />

image

Affected Version Details :

  • <=3.18.1

Impact :

This vulnerability can be exploited by an attacker to gain unauthorized access to the system, execute arbitrary commands, and potentially take control of the affected machine. This could lead to system compromise and other severe security incidents.

Mitigation :

  • Implement rigorous input sanitization for all Markdown content.
  • Utilize a secure Markdown parser that appropriately escapes or strips potentially dangerous content.

References :

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

CVE ID

CVE-2024-41662

Weaknesses

Credits