You need to perform sanitization, validation or encoding with the req.body. It is a risk to blindly accept input that could potentially be tainted or coming from an untrusted source.
I assume that you are expecting input in a form of json so try escaping req.body using the js-string-escape library:
var jsescape = require('js-string-escape');
const someVariable = jsescape(req.body);
await userModelName.create(someVariable);
Now Veracode might not recognize this third-party encoding library and will still fail your scan. You will have to propose this as a mitigation step to your Security team.
Another alternative is to use Mongoose's Validation feature, if you are expecting specific types of data:
const schema = new Schema({
name: {
type: String,
required: true
}
});
const someVariable = escape(req.body);
await userModelName.create(someVariable, schema);
Again, Veracode might not recognize this too but these are secure coding best practices.