在 sequelize where 中使用用户输入作为列名是否安全?
像这样:
var userInput ={"I am unsafe": "I am also an sql injection"};
Post.findAll({
where: userInput
});
最佳答案
Is it safe to use a user input as a colum name in sequelize where?
取决于你所说的安全是什么意思,
如果您只是要求 where 条件,则在您的情况下,如果用户输入无效的列名,sequlize 将引发错误,
用户不能仅通过 where 条件修改任何类型的东西。
在这种情况下,你很高兴。只需正确处理所有错误。
关于sequelize.js - 在 sequelize where 中使用用户输入作为列名是否安全?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53321109/