Skip to content

🛡️ Sentinel: [HIGH] Fix XSS vulnerability in citation-add-modal.tsx#35

Open
aicoder2009 wants to merge 2 commits intomainfrom
sentinel-fix-xss-citation-add-modal-6989015291070718627
Open

🛡️ Sentinel: [HIGH] Fix XSS vulnerability in citation-add-modal.tsx#35
aicoder2009 wants to merge 2 commits intomainfrom
sentinel-fix-xss-citation-add-modal-6989015291070718627

Conversation

@aicoder2009
Copy link
Copy Markdown
Owner

🛡️ Sentinel: [HIGH] Fix XSS vulnerability in citation-add-modal.tsx

🚨 Severity: HIGH
💡 Vulnerability: The application was passing unvalidated HTML variables, specifically generatedCitation.html, to React's dangerouslySetInnerHTML prop in src/components/wiki/citation-add-modal.tsx. This could allow Cross-Site Scripting (XSS).
🎯 Impact: If a citation's contents originated from an untrusted source or were maliciously formatted, an attacker could execute arbitrary scripts in a user's session when the citation preview is rendered.
🔧 Fix: Imported isomorphic-dompurify and used DOMPurify.sanitize() to safely strip malicious scripts from the HTML payload before rendering it.
✅ Verification: Ran unit tests to verify no regressions were introduced. Evaluated that isomorphic-dompurify was already present in package.json as an existing dependency.


PR created automatically by Jules for task 6989015291070718627 started by @aicoder2009

🚨 Severity: HIGH
💡 Vulnerability: The application was passing unvalidated HTML variables, specifically `generatedCitation.html`, to React's `dangerouslySetInnerHTML` prop in `src/components/wiki/citation-add-modal.tsx`. This could allow Cross-Site Scripting (XSS).
🎯 Impact: If a citation's contents originated from an untrusted source or were maliciously formatted, an attacker could execute arbitrary scripts in a user's session when the citation preview is rendered.
🔧 Fix: Imported `isomorphic-dompurify` and used `DOMPurify.sanitize()` to safely strip malicious scripts from the HTML payload before rendering it.
✅ Verification: Ran unit tests to verify no regressions were introduced. Evaluated that `isomorphic-dompurify` was already present in `package.json` as an existing dependency.

Co-authored-by: aicoder2009 <[email protected]>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings April 29, 2026 06:59
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opencitation Ready Ready Preview, Comment May 1, 2026 6:18pm

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Mitigates an XSS risk in the citation preview by sanitizing generated citation HTML before rendering it via dangerouslySetInnerHTML.

Changes:

  • Import isomorphic-dompurify in the citation add modal.
  • Sanitize generatedCitation.html with DOMPurify.sanitize() before passing it to dangerouslySetInnerHTML.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aicoder2009 aicoder2009 closed this May 1, 2026
@aicoder2009 aicoder2009 reopened this May 1, 2026
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.

2 participants