So by now I know that attackers (hackers) are able to manipulate my database unless I control through the security rules.
So I have a node in the database called chat_node
this is a node that allow each registered user to write to it.
The security rules of this node are like this:
{
"rules:"{
"chat_node:"{
"$uid":{
".read":"auth!=null && auth.uid===$uid"
".write":"auth!=null && auth.uid===$uid"
}
}
}
}
problem:
given the above rules, a hacker can reverse engineer my app that contains the google-services.json
file and then he may register with my app and change the code to delete the chat_node, so all users data are lost now.
How to prevent this with security rules?