Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCreate malicious Mermaid/Markdown paste
-
DeliveryEmbed %%{init}%% setting securityLevel:loose
-
ExploitLure victim to view paste
-
ExecutionupdateSiteConfig disables sanitizer
-
PersistStored script executes in victim browser
-
ImpactSteal 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
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).
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
EUVD-2026-127235
GHSA-2cw3-3983-vw2q
NVD
CVE.org
EPSS
Exploit-DB