π‘οΈ Sentinel: [CRITICAL] Fix XSS vulnerability in schema script#287
π‘οΈ Sentinel: [CRITICAL] Fix XSS vulnerability in schema script#287hadsern wants to merge 1 commit into
Conversation
- Replaced direct \`JSON.stringify()\` with an escaped version. - Escaped \`<\`, \`>\` and \`&\` explicitly in JSON to prevent XSS payloads executing through \`<script>\` tag. - Added documentation in \`src/components/SchemaScript.tsx\`. - Added learning to \`.jules/sentinel.md\`. Co-authored-by: hadsern <5723837+hadsern@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π¨ Severity: CRITICAL
π‘ Vulnerability: Cross-Site Scripting (XSS) via unescaped JSON data injected via
dangerouslySetInnerHTMLin<script>tags.π― Impact: If an attacker can inject malicious strings containing
</script><script>alert(1)</script>into schema data (like titles or abstracts), they could break out of the script context and execute arbitrary JS on the user's browser.π§ Fix: Replaced unescaped
JSON.stringifywith an explicitly escaped payload containing unicode equivalents\u003c,\u003e, and\u0026. This ensures standard valid JSON outputs that prevent tags from being correctly parsed as HTML by the browser while still executing correctly as JSON data.β Verification: Verified by checking that
pnpm test,pnpm lint, andpnpm buildstill run without issues, preserving original schema structures and safely handling XSS payloads.PR created automatically by Jules for task 11973464486373373198 started by @hadsern