Skip to content

Fix XSS vulnerability when editing JSON - #81

Open
crimist wants to merge 1 commit into
YYsuni:mainfrom
crimist:crimist/harden-json-rendering
Open

Fix XSS vulnerability when editing JSON#81
crimist wants to merge 1 commit into
YYsuni:mainfrom
crimist:crimist/harden-json-rendering

Conversation

@crimist

@crimist crimist commented Aug 11, 2026

Copy link
Copy Markdown

Summary

Editable primitive values are currently passed to dangerouslySetInnerHTML. A JSON string containing HTML is therefore parsed as DOM when edit mode is opened.

Render the value as a React text child instead, preserving the existing contentEditable behavior while keeping HTML-like values inert.

Vuln PoC

Here's a PoC against the demo website:

image

Payload: {"a":"<img src=x onerror='alert()'>"}

@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

@crimist is attempting to deploy a commit to the Suni's projects Team on Vercel.

A member of the Team first needs to authorize it.

@crimist
crimist marked this pull request as ready for review August 11, 2026 22:12
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