Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!