π‘οΈ Sentinel: [HIGH] Fix XSS Risk in Email Preview - #359
π‘οΈ Sentinel: [HIGH] Fix XSS Risk in Email Preview#359brycejohnson1417 wants to merge 1 commit into
Conversation
Replaced the `dangerouslySetInnerHTML` call in `components/accounts/ppp-savings-panel.tsx` with a properly sandboxed `iframe` using the `srcDoc` attribute to render sanitized HTML for email previews. This mitigates the risk of Cross-Site Scripting (XSS) even if DOMPurify fails to catch all payloads. Co-authored-by: brycejohnson1417 <257422776+brycejohnson1417@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. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75084490bc
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| </div> | ||
| <div className="min-h-[24rem] w-full overflow-auto bg-white p-6 text-sm text-black"> | ||
| <div dangerouslySetInnerHTML={{ __html: sanitizedEmailHtml }} /> | ||
| <iframe |
There was a problem hiding this comment.
Add a title to the email preview iframe
Because this new iframe renders the PPP savings email preview without a title, assistive technologies expose it as an unnamed frame; users navigating the account panel by frames cannot tell what content they are entering. This file was part of the recent accessibility pass, so please give the iframe a descriptive title such as PPP savings email preview.
Useful? React with πΒ / π.
π¨ Severity: HIGH
π‘ Vulnerability: The PPP savings panel was rendering user-controlled or external email content using
dangerouslySetInnerHTML.π― Impact: High potential for Cross-Site Scripting (XSS) attacks, even with DOMPurify, as bypasses can occur.
π§ Fix: Replaced
dangerouslySetInnerHTMLwith a sandboxed<iframe>using thesrcDocattribute. Thesandboxattribute is strictly configured to onlyallow-popupsandallow-popups-to-escape-sandbox, blocking script execution. Added inline CSS to the iframe to match original styling context.β Verification: Checked component locally via Playwright verifying that the
iframecorrectly renders the sanitized HTML and blocks scripts.PR created automatically by Jules for task 13638645003134045957 started by @brycejohnson1417