Skip to content

XSS to RCE in markdown-preview via outdated DOMPurify in Pulsar

High
DeeDeeG published GHSA-f74r-rg9c-3r8m May 3, 2025

Package

Pulsar

Affected versions

< 1.128.0

Patched versions

1.128.0

Description

Summary

Pulsar’s markdown-preview package relies on an outdated version of DOMPurify (v2.0.17), which is vulnerable to a known XSS bypass (CVE-2024-47875). This allows attackers to inject and execute arbitrary JavaScript in the markdown preview feature.

Details

Since markdown-preview renders user-controlled Markdown with DOMPurify, crafted input can bypass sanitization. Furthermore, due to nodeIntegration: true and contextIsolation: false in Pulsar’s Electron config, this XSS leads to RCE.

PoC

Using a crafted payload with deep HTML nesting and an <iframe srcdoc> pointing to a script (e.g., /proc/self/cwd/poc.js), an attacker can trigger execution of arbitrary JavaScript and escalate to system command execution.

Impact

RCE

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
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
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:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

CVE ID

CVE-2024-47875

Weaknesses

No CWEs

Credits