Skip to content

Fix security vulnerabilities: XSS, postMessage origin validation, and…#491

Draft
Syedsmaeel wants to merge 4455 commits into
ProtonMail:mainfrom
Syedsmaeel:security-fixes
Draft

Fix security vulnerabilities: XSS, postMessage origin validation, and…#491
Syedsmaeel wants to merge 4455 commits into
ProtonMail:mainfrom
Syedsmaeel:security-fixes

Conversation

@Syedsmaeel
Copy link
Copy Markdown

Security Hardening: XSS Prevention and Cross-Window Communication Security

This PR implements critical security improvements and "defense-in-depth" measures across several applications within the Proton WebClients
monorepo. The focus is on preventing Cross-Site Scripting (XSS), securing postMessage communication, and hardening external link handling.

Key Changes

  1. Account Application: XSS Prevention
  • Issue: The user signature was rendered directly using dangerouslySetInnerHTML in the mobile address section without client-side sanitization.
  • Fix: Integrated @proton/sanitize and applied sanitizeMessage() to all signature rendering. This ensures that even if malicious content reaches
    the client, it is neutralized before being injected into the DOM.
  • Files: applications/account/src/lite/components/Address/MobileAddressSection.tsx, applications/account/package.json
  1. Wallet Application: postMessage Origin Validation
  • Issue: The Bitcoin checkout component listened for window messages without validating the event.origin, and checkout success/failure pages sent
    messages using the wildcard * target.
  • Fix:
    • Implemented strict origin validation in Checkout/index.tsx, allowing only the local origin and the verified volt.io domain.
    • Replaced wildcard target origins with window.location.origin in all static checkout HTML files to prevent sensitive state leakage.
  • Files: applications/wallet/src/app/components/BitcoinBuyModal/Checkout/index.tsx, applications/wallet/public/checkout/*.html
  1. Docs Application: Secure Document Duplication
  • Issue: The PublicDocumentCopier component processed postMessage requests for document copying without verifying the source.
  • Fix: Added origin validation to the message listener to ensure requests only originate from authorized Proton Docs instances.
  • Files: applications/docs/src/app/routes/(user)/(document)/doc/__components/PublicDocumentCopier.tsx
  1. Account Application: SSO Token Protection
  • Issue: The external SSO consumer used postMessage without a specific target origin, potentially exposing SSO tokens to malicious windows.
  • Fix: Hardened the postMessage call to explicitly target window.location.origin.
  • Files: applications/account/src/app/content/ExternalSSOConsumer.tsx
  1. General: External Link Hardening
  • Issue: Several external links using target="_blank" were missing rel="noopener noreferrer".
  • Fix: Conducted a sweep and added the missing attributes to protect against "tabnabbing" attacks and improve browser performance.
  • Files: Various components in docs, wallet, and account.

Impact
These changes reduce the attack surface for cross-site attacks and ensure that sensitive user data (like SSO tokens and payment status) is handled
securely during cross-window interactions.

StraightOuttaCrompton and others added 30 commits April 15, 2026 17:46
Add recovery phrase to unauth lost 2fa flow

See merge request web/clients!24124
DRVWEB: Implement versioning for Index Populators

See merge request web/clients!24193
Update proton-meet-core to 1.1.6-13

See merge request web/clients!24164
i18n(weekly-mr:app): Upgrade translations from crowdin (389a334). for webapps

See merge request web/clients!24195
DRVWEB: Search errors sentry/comlink hardening 💪

See merge request web/clients!24163
Add comparison table component

See merge request web/clients!24174
Improving Meet recording performance

See merge request web/clients!21340
Feedback first cancellation flow: different account content

See merge request web/clients!24074
fix(INDA-675): Fix snap running under wayland/x11 with Electron v40

See merge request web/clients!24171
MargeBot and others added 28 commits April 22, 2026 07:16
Add debug mail store button and modal

See merge request web/clients!24332
Add Unauth lost 2fa e2e tests

See merge request web/clients!24192
change "pass unlimited" to "proton unlimited"

See merge request web/clients!24279
Added 1domain support for vpnbiz2023

See merge request web/clients!24336
Report block verification to erroring users

See merge request web/clients!24340
Attempt to fix drawer apps that cannot be closed

See merge request web/clients!24089
Avoid layout shift when typing in empty composer

See merge request web/clients!24330
Tech: add useSubscriptionCheck hook

See merge request web/clients!24276
Fix recovery issue with photos

See merge request web/clients!24345
Fix bad org or group name causing issues

See merge request web/clients!24324
Final polishes and orchestrator component for cancellation flow

See merge request web/clients!24146
MEET-279: participants role, share screen slice and other UIs fixes

See merge request web/clients!24334
DRVWEB-5359: Include trashed items in search index (without exposing them to search queries)

See merge request web/clients!24300
[IDTEAM-5924] Remove cycle param in pass signup, keep the cycle page

See merge request web/clients!24328
@Syedsmaeel Syedsmaeel marked this pull request as draft April 22, 2026 16:30
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.