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

228
Vistas
Mysql INSERT INTO SET ? syntax
await query(`INSERT INTO feedback.app_v2 SET ?`, feedback)

I wrote this line to code into my JS project to insert data in the concerning table.

I want to ask if this MySql syntax is safe from Sql Injection? Here feedback is an object whose keys matches the app_v2 table columns.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

That's not valid MySQL syntax.

This is valid MySQL syntax:

INSERT INTO feedback.app_v2 SET mycolumn = ?

Yes, it is safe from SQL injection, because the dynamic value is restricted to a query parameter. This is not combined with the query until after the query has been parsed, so there is no way the parameter can introduce unintended syntax.


If the NPM package can do string substitution to put the key = 'value' syntax into the query string, that's not a true query parameter. The assignment must be part of the query before it is parsed, but proper query parameters are not combined with the query until after it is parsed.

So you're depending on the code in the NPM package to do the string substitution without any bugs that result in SQL injection vulnerability.

about 4 years ago · Juan Pablo Isaza Denunciar
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