VYPR
Medium severity6.1NVD Advisory· Published Dec 9, 2025· Updated Apr 29, 2026

CVE-2025-14284

CVE-2025-14284

Description

Versions of the package @tiptap/extension-link before 2.10.4 are vulnerable to Cross-site Scripting (XSS) due to unsanitized user input allowed in setting or toggling links. An attacker can execute arbitrary JavaScript code in the context of the application by injecting a javascript: URL payload into these attributes, which is then triggered either by user interaction.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
@tiptap/extension-linknpm
< 2.10.42.10.4

Affected products

1

Patches

2
1c2fefe3d61a

Fixed Link extension's commands not respecting XSS prevention via unallowed protocols (#5945)

https://github.com/ueberdosis/tiptapbdbchDec 19, 2024via ghsa
3 files changed · +32 3
  • .changeset/empty-seals-join.md+5 0 added
    @@ -0,0 +1,5 @@
    +---
    +"@tiptap/extension-link": patch
    +---
    +
    +Added checks for allowed protocols in link commands & exported isValidUri helper for manual checks outside of the extension
    
  • demos/src/Marks/Link/React/index.jsx+6 2 modified
    @@ -105,8 +105,12 @@ export default () => {
         }
     
         // update link
    -    editor.chain().focus().extendMarkRange('link').setLink({ href: url })
    -      .run()
    +    try {
    +      editor.chain().focus().extendMarkRange('link').setLink({ href: url })
    +        .run()
    +    } catch (e) {
    +      alert(e.message)
    +    }
       }, [editor])
     
       if (!editor) {
    
  • packages/extension-link/src/link.ts+21 1 modified
    @@ -160,7 +160,7 @@ declare module '@tiptap/core' {
     // eslint-disable-next-line no-control-regex
     const ATTR_WHITESPACE = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
     
    -function isAllowedUri(uri: string | undefined, protocols?: LinkOptions['protocols']) {
    +export function isAllowedUri(uri: string | undefined, protocols?: LinkOptions['protocols']) {
       const allowedProtocols: string[] = [
         'http',
         'https',
    @@ -322,11 +322,31 @@ export const Link = Mark.create<LinkOptions>({
         return {
           setLink:
             attributes => ({ chain }) => {
    +          const { href } = attributes
    +
    +          if (!this.options.isAllowedUri(href, {
    +            defaultValidate: url => !!isAllowedUri(url, this.options.protocols),
    +            protocols: this.options.protocols,
    +            defaultProtocol: this.options.defaultProtocol,
    +          })) {
    +            return false
    +          }
    +
               return chain().setMark(this.name, attributes).setMeta('preventAutolink', true).run()
             },
     
           toggleLink:
             attributes => ({ chain }) => {
    +          const { href } = attributes
    +
    +          if (!this.options.isAllowedUri(href, {
    +            defaultValidate: url => !!isAllowedUri(url, this.options.protocols),
    +            protocols: this.options.protocols,
    +            defaultProtocol: this.options.defaultProtocol,
    +          })) {
    +            return false
    +          }
    +
               return chain()
                 .toggleMark(this.name, attributes, { extendEmptyMarkRange: true })
                 .setMeta('preventAutolink', true)
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.