Skip to content

fix: sanitize component props to prevent reflected XSS#542

Closed
harlan-zw wants to merge 2 commits intomainfrom
fix/reflected-xss-ghsa-mg36-wvcr-m75h
Closed

fix: sanitize component props to prevent reflected XSS#542
harlan-zw wants to merge 2 commits intomainfrom
fix/reflected-xss-ghsa-mg36-wvcr-m75h

Conversation

@harlan-zw
Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Resolves GHSA-mg36-wvcr-m75h

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Query params not matching known OG image options (like width, height, component) were forwarded as component props to the Nuxt island renderer. Vue's fallthrough attributes then rendered unknown props as HTML attributes on the root element, enabling injection of event handlers (onmouseover, onclick, etc.) and dangerous attributes (autofocus).

Adds sanitizeProps() which strips on* event handlers and a set of dangerous HTML attributes (autofocus, contenteditable, tabindex, accesskey) from props before they reach the island renderer. Includes unit tests.

…r-m75h)

Query params not matching known OG image options were passed as component
props to the Nuxt island renderer. Vue's fallthrough attributes then
rendered them as HTML attributes on the root element, enabling injection
of event handlers like onmouseover.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 26, 2026

Open in StackBlitz

npm i https://pkg.pr.new/nuxt-og-image@542

commit: 918fdec

@harlan-zw harlan-zw closed this Mar 26, 2026
@harlan-zw harlan-zw deleted the fix/reflected-xss-ghsa-mg36-wvcr-m75h branch March 26, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant