Skip to content

Commit 8577eb2

Browse files
committed
Do not allow double slashes
1 parent 2b22838 commit 8577eb2

File tree

1 file changed

+2
-2
lines changed
  • packages/auth/src/platform_browser

1 file changed

+2
-2
lines changed

packages/auth/src/platform_browser/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ export function getAuth(app: FirebaseApp = getApp()): Auth {
9191

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

0 commit comments

Comments
 (0)