Intel

AIKIDO-2026-420462

@clerk/shared is vulnerable to Cross-site Scripting (XSS)

Cross-site Scripting (XSS) Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 4 days ago

71

High Risk

This Affects:

JS@clerk/shared
0.0.1 - 4.25.4
Fixed in 4.25.5
Are you affected? Scan for Free

TL;DR

Affected versions of @clerk/shared are vulnerable to stored Cross-site Scripting (XSS) when Clerk auth state is serialized into SSR <script> tags. JSON.stringify leaves <, >, and / unescaped, so a </script> sequence inside user-controllable session claims can break out of the script element and execute arbitrary JavaScript. The fix introduces htmlSafeJson, which escapes those characters (and U+2028/U+2029) to Unicode escapes so the embedded JSON still parses to identical values on the client.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

@clerk/shared is vulnerable to Cross-site Scripting (XSS) in versions 0.0.1 - 4.25.4.

How to fix this

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