The vulnerability exists in the unhead library, specifically within the safe plugin utilized by the useHeadSafe() composable. The core issue is an incomplete HTML entity decoding mechanism in the decodeHtmlEntities function. The regular expressions responsible for identifying and decoding numeric HTML entities impose a fixed limit on the number of digits they can match. An attacker can exploit this by crafting an HTML entity with an excessive number of leading zeros, thereby exceeding the regex limit and preventing the entity from being decoded. This undecoded, malicious string is then passed to the hasDangerousProtocol function, which is designed to detect and block dangerous protocols such as javascript:. Because the malicious payload is not in its decoded form, the check is bypassed. Consequently, the unsanitized string is rendered directly into the HTML. The browser, upon parsing the HTML, decodes the entity and executes the embedded script, leading to a cross-site scripting (XSS) vulnerability. The patch addresses this by removing the digit limit from the regular expressions, which ensures that all numeric HTML entities are correctly decoded and subsequently sanitized.