Skip to content

Conversation

@deepak0x
Copy link
Contributor

@deepak0x deepak0x commented Jan 21, 2026

This pull request fixes a critical security vulnerability in the OAuth login flow where the application accepted OAuth callback messages from any origin.

Previously, the postMessage event listener in loginWithRocketChatOAuth did not validate the origin of incoming messages. This allowed malicious websites to forge OAuth callbacks and potentially force users to log in with attacker-controlled accounts.

Closes #1071

Fix

  • Added validation to ensure event.origin matches the trusted Rocket.Chat server origin
  • The expected origin is derived from config.api.baseUrl
  • Messages from untrusted origins are ignored

Only messages from the configured Rocket.Chat server are now accepted.

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.

Missing Origin Validation in OAuth Callback (Login CSRF)

1 participant