File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
packages/auth/src/platform_browser Expand file tree Collapse file tree 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 {
8989 ]
9090 } ) ;
9191
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 ) ;
9597 beforeAuthStateChanged ( auth , mintCookie , ( ) =>
9698 mintCookie ( auth . currentUser )
9799 ) ;
You can’t perform that action at this time.
0 commit comments