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

180
Vistas
Is NodeJS POST data (req.body) can be attacked/change/inject by hacker?

first of all, sorry for my bad English :)

Let say I have a model and controller for my REST API,

PostModel.js:

const postSchema = new mongoose.Schema({
    author: {
        type: mongoose.Types.ObjectId, 
        required: true
    },
    title: String,
    content: String
})

postController.js:

const createPost = async (req, res, next) => {
   const newPost = await Post.create(req.body);

   res.status(200).json bla bla bla
}

is data from req.body can be (edit / attack / inject) by the client?

I imagine like this:

  1. from frontend, form only have title and description fields
  2. user fill the title and description
  3. and user force attack/injects the author id to another user id

Thanks <3

over 4 years ago · Santiago Trujillo
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