Skip to content

markup: restrict data URI scheme to safe image MIME types#8174

Merged
unknwon merged 1 commit intomainfrom
unknwon/fix-ghsa-xrcr-gmf5
Feb 11, 2026
Merged

markup: restrict data URI scheme to safe image MIME types#8174
unknwon merged 1 commit intomainfrom
unknwon/fix-ghsa-xrcr-gmf5

Conversation

@unknwon
Copy link
Member

@unknwon unknwon commented Feb 11, 2026

Summary

  • Restrict the data: URL scheme in the HTML sanitizer to only allow safe image MIME types (png, jpeg, gif, webp, x-icon) instead of blanket-allowing all data URIs.
  • Add test coverage for both allowed and blocked data URI patterns.

Ref: GHSA-xrcr-gmf5-2r8j

The HTML sanitizer was configured to blanket-allow all data: URIs,
which enabled stored XSS via data:text/html payloads in raw HTML
anchor tags. Restrict the data: scheme to only allow safe image
MIME types (png, jpeg, gif, webp, x-icon).

Ref: GHSA-xrcr-gmf5-2r8j

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@unknwon unknwon added this to the 0.14.2 milestone Feb 11, 2026
@unknwon unknwon merged commit 441c64d into main Feb 11, 2026
12 checks passed
@unknwon unknwon deleted the unknwon/fix-ghsa-xrcr-gmf5 branch February 11, 2026 03:26
unknwon added a commit that referenced this pull request Feb 19, 2026
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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