The vulnerability is a classic prototype pollution issue in a custom assign function within the linkifyjs library. The root cause is the assign function in packages/linkifyjs/src/assign.mjs, which fails to validate property names before copying them, specifically ignoring the __proto__ property. This allows an attacker to modify the Object.prototype.
The primary exploit vector is through the Options constructor, which uses this vulnerable assign function to process user-provided options. By crafting a malicious options object, an attacker can inject properties into the prototype of all objects created within the application.
The vulnerability manifests as an XSS when the polluted attributes are used to render HTML links. The MultiToken.prototype.render function is a key part of this, as it uses the vulnerable assign function to merge attributes before creating the final HTML. An attacker can inject event handlers like onclick into the prototype, which will then be added to all generated links, leading to stored or reflected XSS.
The patch addresses the vulnerability by completely removing the custom assign function and replacing all its usages with the built-in Object.assign, which is not vulnerable to prototype pollution. The analysis identified all the locations where the vulnerable assign function was used, as these are all points where the vulnerability could be triggered or propagated.