---
id: CVE-2026-74234
title: >-
  Legora before 2026-08-14 contains a cross-site scripting vulnerability that
  allows attackers to achieve arbitrary JavaScript execution in a victim's
  browser by embedding a Mermaid block prefixed with a gray-matter JavaScript
  front-matter…
summary: >-
  Legora before 2026-08-14 contains a cross-site scripting vulnerability that
  allows attackers to achieve arbitrary JavaScript execution in a victim's
  browser by embedding a Mermaid block prefixed with a gray-matter JavaScript
  front-matter…
severity: high
cvss: 7.7
cvssVector: 'CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N'
cwe:
  - CWE-95
published: '2026-08-17'
updated: '2026-08-21'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-74234'
references:
  - url: 'https://legora.com/'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/legora-2026-08-14-xss-via-mermaid-gray-matter-javascript-engine
    label: disclosure@vulncheck.com
tags:
  - nvd
epss: 0.0028
epssPercentile: 0.19999
ingestedAt: '2026-08-22T13:32:36.342Z'
---

## Overview

Legora before 2026-08-14 contains a cross-site scripting vulnerability that allows attackers to achieve arbitrary JavaScript execution in a victim's browser by embedding a Mermaid block prefixed with a gray-matter JavaScript front-matter directive, causing the front-matter parser to invoke eval() before any SVG sanitization occurs. Attackers can exploit this flaw through influenced Mermaid diagram content to execute arbitrary JavaScript in the user's browser context, with elevated impact on Word and Outlook add-in surfaces where bearer session tokens are persisted in localStorage.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
