Skip to content

πŸ›‘οΈ Sentinel: [HIGH] Fix XSS Risk in Email Preview - #359

Open
brycejohnson1417 wants to merge 1 commit into
mainfrom
sentinel-fix-xss-dangerouslysetinnerhtml-13638645003134045957
Open

πŸ›‘οΈ Sentinel: [HIGH] Fix XSS Risk in Email Preview#359
brycejohnson1417 wants to merge 1 commit into
mainfrom
sentinel-fix-xss-dangerouslysetinnerhtml-13638645003134045957

Conversation

@brycejohnson1417

Copy link
Copy Markdown
Owner

🚨 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 dangerouslySetInnerHTML with a sandboxed <iframe> using the srcDoc attribute. The sandbox attribute is strictly configured to only allow-popups and allow-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 iframe correctly renders the sanitized HTML and blocks scripts.


PR created automatically by Jules for task 13638645003134045957 started by @brycejohnson1417

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>
@google-labs-jules

Copy link
Copy Markdown

πŸ‘‹ 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.

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
map-app-supabase Ready Ready Preview, Comment Jul 8, 2026 10:44am

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ’‘ 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 πŸ‘Β / πŸ‘Ž.

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