Skip to main content

Pastefy CVE-2026-130866

| EUVDEUVD-2026-127235 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-11-17 VulnCheck GHSA-2cw3-3983-vw2q
5.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Create malicious Mermaid/Markdown paste
  2. Delivery
    Embed %%{init}%% setting securityLevel:loose
  3. Exploit
    Lure victim to view paste
  4. Execution
    updateSiteConfig disables sanitizer
  5. Persist
    Stored script executes in victim browser
  6. Impact
    Steal API session key and hijack account

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires an attacker to create a Mermaid-diagram or Markdown paste whose content begins with a %%{init}%% directive that sets Mermaid's securityLevel to 'loose' together with a permissive dompurifyConfig; MermaidViewer.vue (versions 7.2.1 through 7.2.6) parses this directive and passes it to mermaid.mermaidAPI.updateSiteConfig(), relaxing DOMPurify so injected markup executes. The attacker needs no authentication to create the paste (PR:N). The key limiting factor is required user interaction (UI:P): a victim - ideally a logged-in user whose API session key is worth stealing - must actually open and view the malicious paste for the stored script to fire. The fixed release (7.2.7) forces securityLevel:'strict', marks dompurifyConfig as a protected/secure field, and stops forwarding attacker init directives, so updating is the vendor's remedy.

Impact

Signals point to a genuine but mid-tier risk rather than an emergency. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:P) shows a network-reachable, low-complexity flaw an unauthenticated attacker can arm, but exploitation is gated on victim interaction (UI:P) - a viewer must open the malicious paste - and impact is rated Low across confidentiality and integrity (VC:L/VI:L), consistent with session-key theft and account actions rather than full system compromise. This yields a modest 5.3 base score. The vuln.today decision label is 'this_month' (not act_now/emergency), which aligns with the moderate score. There is no CISA KEV listing and no EPSS score supplied, so there is no evidence of active or widespread exploitation - exploitation status is therefore 'no public exploit identified at time of analysis', though a VulnCheck advisory and a public GitHub issue (#142), patch commit, and the exact vulnerable source lines are all published, which lowers the barrier to weaponization. Net: a real, patch-this-month stored-XSS issue in a self-hosted pastebin, not a high-urgency internet emergency; the main limiter is the required victim interaction, and no EPSS/KEV data is available to gauge in-the-wild activity.

Exploit ScenarioDerived

An unauthenticated attacker creates a Mermaid or Markdown paste containing a %%{init}%% directive that sets securityLevel to 'loose' with a permissive dompurifyConfig, which MermaidViewer.vue forwards to mermaid.mermaidAPI.updateSiteConfig(), disabling sanitization so embedded script executes when a victim views the paste. When a logged-in user opens the link, the injected JavaScript runs in their browser session and exfiltrates their Pastefy API session key, letting the attacker act on the victim's account. No confirmed public exploit code is identified, but the vulnerable code path, patch commit, and a VulnCheck advisory are published.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 18, 2026

Stored cross-site scripting in Pastefy 7.2.1 through 7.2.6 lets an unauthenticated attacker publish a Mermaid or Markdown paste that smuggles a %%{init}%% directive past the preview renderer, flipping Mermaid into 'loose' security mode with a weakened DOMPurify configuration so injected markup runs in the viewer's browser and can exfiltrate API session keys to take over accounts. The MermaidViewer.vue component parses the leading directive and forwards it to mermaid.mermaidAPI.updateSiteConfig(), so the payload is persisted server-side and fires whenever someone opens the paste; the practical limiting factor is that a victim, ideally a signed-in user whose key is worth stealing, must actually view the paste. Severity is assessed as mid-tier (CVSS 5.3, assessed 3.1 vector AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N) because the attack chain depends on that user interaction; no public exploit code has been identified at time of analysis and the issue is not in CISA KEV, but the vendor has published a fix in 7.2.7.

RemediationAI

Vendor-released patch: Pastefy 7.2.7. Upgrade any 7.2.1 through 7.2.6 deployment to 7.2.7 (https://github.com/interaapps/pastefy/releases/tag/7.2.7), which pins Mermaid securityLevel to 'strict', registers dompurifyConfig as a protected 'secure' setting, and removes the code path that forwarded paste-supplied %%{init}%% directives to mermaid.mermaidAPI.updateSiteConfig(); the patch itself is commit https://github.com/interaapps/pastefy/commit/caf35d8f279e2e1386a066753f2d644a0ba79507, and per the assessment updating is the vendor's complete remedy. If the upgrade cannot be applied immediately, the actionable compensating control is to remove or disable the Mermaid preview rendering for untrusted pastes (or block paste creation/content viewing for anonymous users) until 7.2.7 is deployed, accepting that this degrades functionality for legitimate diagram pastes; because the payload is stored server-side, also purge or quarantine pastes created before the fix that begin with a %%{init}%% directive. Note the fix commit additionally tightens the HTML preview iframe sandbox and bumps markdown-it to ^14.3.3, so deploying the full 7.2.7 frontend bundle rather than cherry-picking a single change is preferable. Session/API keys already exposed to a malicious paste should be rotated, since stolen keys allow the attacker to act on victims' accounts.

Affected VersionsENISA

Pastefy 7.2.1 <7.2.7

Affected Packages

euvd pastefy fix: 7.2.7

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Pastefy renders fenced Mermaid diagrams client-side in a Vue single-file component, frontend/src/components/previews/MermaidViewer.vue, which prior to 7.2.7 scanned the raw paste text for a leading %%{init: {...}}%% directive, JSON-parsed it, and handed the resulting object to mermaid.mermaidAPI.updateSiteConfig(). That API mutates Mermaid's global site configuration, including securityLevel and dompurifyConfig, which controls the DOMPurify instance Mermaid uses to sanitize generated SVG. An attacker-supplied directive converting securityLevel from the default 'strict' to 'loose' and supplying a permissive dompurifyConfig therefore disables the sanitization boundary that normally blocks script and event-handler markup in diagram labels, yielding classic CWE-79 stored cross-site scripting through a legitimate rendering feature. The upstream fix in commit caf35d8f pins securityLevel to 'strict', appends 'dompurifyConfig' to Mermaid's protected 'secure' field list so diagrams cannot rewrite the sanitizer, and deletes the local resolveMermaidInput()/updateSiteConfig() path so directives are handled only by Mermaid's own checks. The same commit also hardens the adjacent HTMLViewer.vue preview by removing 'allow-same-origin' from the iframe sandbox and adding referrerpolicy="no-referrer", and bumps markdown-it to ^14.3.3 (with linkify-it 5.0.2) in the frontend dependency manifests, indicating the renderer stack was reviewed as part of the same hardening pass.

Know when Pastefy gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 5.3 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
vuln.today AI 6.1 MEDIUM

Unauthenticated attacker stores the payload (PR:N) but a viewer must open the paste (UI:R); script runs in the victim's browser context (S:C) stealing a session key and enabling account actions (C:L/I:L).

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

DescriptionCVE.org

Pastefy 7.2.1 before 7.2.7 contains a stored cross-site scripting vulnerability in MermaidViewer.vue that passes attacker-supplied %%{init}%% directives to mermaid.mermaidAPI.updateSiteConfig(). Unauthenticated attackers can create Mermaid or Markdown pastes setting securityLevel to loose with a permissive dompurifyConfig to steal viewers' API session keys and act on their accounts.

Threat Intelligence Overview

EPSS Score
0.4%
Top 69% exploitable
Prevalence
Low
self-hosted open-source pastebin, niche developer tool with small footprint
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy