Fixes to Firebase security