Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

133
Vistas
How to avoid hackers from writing in firebase database too much data?

I am building a firebase app that uses the realtime database. Using developer tools users can read that when they press a button their input is written in the "post" child of the database:

document.getElementById("sub").addEventListener("click", function() {
    var postText = document.getElementById("postbox").value;
    var firebaseRef = firebase.database().ref();
    firebaseRef.child("post").set(postText);
});

Suppose the user modifies the javascript file with a loop and writes authomatically lots of time whatever they want once they press the submit button:

document.getElementById("sub").addEventListener("click", function() {
     for (let i = 0; i < 100000000000000000000000; i++) {
     var firebaseRef = firebase.database().ref();
     firebaseRef.child("post").set("I have hacked u");
     }
});

If this happens I wuold end up with a huge bill if I am not careful + other issues with the website not properly working.
How do I prevent symilar uncontrolable writing events from occouring? Also authenticated users can do this trick if they know some coding...are cloud functions the only option to secure my database?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda