Skip to content

Commit

Permalink
Merge af52435 into 2b22838
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 authored Mar 8, 2024
2 parents 2b22838 + af52435 commit a00c3e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-avocados-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/auth': patch
---

Do not allow double slash at beginning of authTokenSyncURL. (follow-up fix to https://github.com/firebase/firebase-js-sdk/pull/8056)
4 changes: 2 additions & 2 deletions packages/auth/src/platform_browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export function getAuth(app: FirebaseApp = getApp()): Auth {

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

0 comments on commit a00c3e9

Please sign in to comment.