Skip to content

Commit

Permalink
Merge d8cac08 into e60188d
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 authored Mar 5, 2024
2 parents e60188d + d8cac08 commit 0088e11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/thirty-otters-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/auth': patch
---

Fix possible XSS vulnerability through **FIREBASE_DEFAULTS** settings.
8 changes: 5 additions & 3 deletions packages/auth/src/platform_browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ export function getAuth(app: FirebaseApp = getApp()): Auth {
]
});

const authTokenSyncUrl = getExperimentalSetting('authTokenSyncURL');
if (authTokenSyncUrl) {
const mintCookie = mintCookieFactory(authTokenSyncUrl);
const authTokenSyncPath = getExperimentalSetting('authTokenSyncURL');
// Don't allow urls (XSS possibility), only paths on the same domain
// (starting with '/')
if (authTokenSyncPath && authTokenSyncPath.startsWith('/')) {
const mintCookie = mintCookieFactory(authTokenSyncPath);
beforeAuthStateChanged(auth, mintCookie, () =>
mintCookie(auth.currentUser)
);
Expand Down

0 comments on commit 0088e11

Please sign in to comment.