Skip to content

fix(preview): prevent raw HTML rendering in generated README preview#89

Open
msn698 wants to merge 1 commit intoVishwaGauravIn:mainfrom
msn698:fix/secure-preview-render-links
Open

fix(preview): prevent raw HTML rendering in generated README preview#89
msn698 wants to merge 1 commit intoVishwaGauravIn:mainfrom
msn698:fix/secure-preview-render-links

Conversation

@msn698
Copy link
Copy Markdown

@msn698 msn698 commented Mar 30, 2026

Summary

This PR hardens preview rendering in the Preview component by:

  • setting markdown-it option html: false (instead of html: true)
  • adding rel="noopener noreferrer nofollow" on rendered links opened with target="_blank"

Why

The preview renders user-generated markdown via innerHTML. Allowing raw HTML in markdown can expose users to script/style injection in preview context. Disabling raw HTML keeps markdown rendering but blocks direct HTML injection.

The link rel addition prevents reverse-tabnabbing and improves outbound link safety.

Scope

Small, isolated security-focused change.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

@msn698 is attempting to deploy a commit to the vishwagauravin's projects Team on Vercel.

A member of the Team first needs to authorize it.

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