security: fix critical DOM-based XSS in browser extension#459
security: fix critical DOM-based XSS in browser extension#459akhilesharora wants to merge 1 commit intosupermemoryai:mainfrom
Conversation
Fix DOM-based XSS vulnerability in ChatGPT and Claude content scripts where unsanitized API responses were injected via innerHTML. Changes: - Replace innerHTML with textContent in chatgpt.ts and claude.ts - HTML is now automatically escaped to prevent script execution - Functionality remains unchanged This prevents session hijacking, data exfiltration, and account takeover.
How to use the Graphite Merge QueueAdd the label Main to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
|
thanks for the PR @akhilesharora will take a look right away |
Security Review: DOM-based XSS FixSummaryThis PR addresses a critical security vulnerability by replacing innerHTML with safe DOM manipulation. The fix is correct in principle but has implementation issues that need attention. ✅ Strengths
|
Security PR Review: DOM-based XSS Fix✅ Overall AssessmentRecommendation: Approve with minor concerns and suggestions This PR addresses a critical security vulnerability and should be prioritized for merge and release. The fix correctly addresses the DOM-based XSS issue by replacing 🔒 Security Analysis✅ Strengths
|
@akhilesharora any update on this comment? |
|
closing for inactivity |


Summary
Fixes critical DOM-based XSS vulnerability in browser extension content scripts for ChatGPT and Claude integrations.
Problem
The extension was using
innerHTMLto inject API responses into the DOM without sanitization. If the Supermemory API is compromised or a MITM attack occurs, malicious JavaScript could execute in the context of ChatGPT/Claude, leading to:Vulnerable code:
Solution
Replace
innerHTMLwithtextContentwhich automatically escapes HTML:Files Changed
apps/browser-extension/entrypoints/content/chatgpt.ts(line 656)apps/browser-extension/entrypoints/content/claude.ts(line 514)Testing
Impact
Severity: Critical
Affected: All browser extension users
Fix: 3 lines per file
This is a security-critical fix that should be merged and released as soon as possible.