The vulnerability is a Cross-site Scripting (XSS) issue in the @tiptap/extension-link package. It stems from the lack of input sanitization in the setLink and toggleLink commands. These functions are responsible for creating and modifying links in the tiptap editor. Before the patch, they would accept any string as the href attribute for a link, including malicious javascript: payloads. When a user clicks on a link created with such a payload, the embedded JavaScript code executes in the browser, leading to XSS. The patch, identified in commit 1c2fefe3d61ab1c8fbaa6d6b597251e1b6d9aaed, rectifies this by introducing a validation step. It adds checks within both setLink and toggleLink that use a new isAllowedUri helper function. This function ensures that the URL protocol is one of the allowed types (e.g., 'http', 'https', 'mailto'), effectively blocking javascript: URLs and mitigating the vulnerability.