File tree 2 files changed +10
-3
lines changed
packages/auth/src/platform_browser
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @firebase/auth ' : patch
3
+ ---
4
+
5
+ Fix possible XSS vulnerability through ** FIREBASE_DEFAULTS** settings.
Original file line number Diff line number Diff line change @@ -89,9 +89,11 @@ export function getAuth(app: FirebaseApp = getApp()): Auth {
89
89
]
90
90
} ) ;
91
91
92
- const authTokenSyncUrl = getExperimentalSetting ( 'authTokenSyncURL' ) ;
93
- if ( authTokenSyncUrl ) {
94
- const mintCookie = mintCookieFactory ( authTokenSyncUrl ) ;
92
+ const authTokenSyncPath = getExperimentalSetting ( 'authTokenSyncURL' ) ;
93
+ // Don't allow urls (XSS possibility), only paths on the same domain
94
+ // (starting with '/')
95
+ if ( authTokenSyncPath && authTokenSyncPath . startsWith ( '/' ) ) {
96
+ const mintCookie = mintCookieFactory ( authTokenSyncPath ) ;
95
97
beforeAuthStateChanged ( auth , mintCookie , ( ) =>
96
98
mintCookie ( auth . currentUser )
97
99
) ;
You can’t perform that action at this time.
0 commit comments