1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

fix(auth): [PM-1779] replace wildcard with window.location.origin in postMessage

Improve security by using specific origin instead of wildcard in postMessage calls to prevent potential information leakage to third parties.

PM-1779
This commit is contained in:
Alec Rippberger
2025-04-10 14:55:26 -05:00
committed by GitHub
parent 3ad6a98e21
commit 1e7d54f7fb
2 changed files with 2 additions and 2 deletions

View File

@@ -32,7 +32,7 @@ function initiateWebAppSso(code: string, state: string) {
}
function initiateBrowserSso(code: string, state: string, lastpass: boolean) {
window.postMessage({ command: "authResult", code: code, state: state, lastpass: lastpass }, "*");
window.postMessage({ command: "authResult", code, state, lastpass }, window.location.origin);
const handOffMessage = ("; " + document.cookie)
.split("; ssoHandOffMessage=")
.pop()