Intel

AIKIDO-2026-624585

@vue/shared is vulnerable to Cross-Site Scripting (XSS)

Cross-Site Scripting (XSS)GHSA-9rff-vwfp-83hv Published 5 days ago

59

Medium Risk

This Affects:

JS@vue/shared
3.0.0 - 3.5.39
Fixed in 3.5.40
Are you affected? Scan for Free

TL;DR

The escapeHtmlComment helper in @vue/shared sanitizes comment content during server-side rendering by stripping HTML comment delimiter sequences. It performs a single regex pass, so crafted input containing overlapping or adjacent comment markers can reconstruct a --> sequence that survives sanitization. When an application renders attacker-influenced data inside a comment vnode, this prematurely closes the server-rendered comment and lets injected markup be parsed as HTML, enabling cross-site scripting. The fix repeatedly strips comment delimiter fragments until the output is stable so no closing delimiter can be produced.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your application renders untrusted content inside HTML comments during server-side rendering.

Background info

@vue/shared is vulnerable to Cross-Site Scripting (XSS) in versions 3.0.0 - 3.5.39.

How to fix this

Upgrade the @vue/shared library to the patch version.