NoSQL 数据库的 SQL 注入?
我目前正在使用 mongoDB,我想知道我们应该采取什么措施来确保不存储任何可能导致问题的数据。我相信像 mysql_escape_string
这样的普通 PHP 函数在这里没有帮助...
是否有针对 noSQL 数据库,特别是 mongoDB 的 SQL 注入?
如果是这样,我们可以做什么来保护我们免受它们的侵害?
I am using mongoDB currently, and I am wondering what measures we should take to ensure that any data that could cause problems isn't stored. I believe that normal PHP functions like mysql_escape_string
isn't going to help here...
Is there SQL injections for noSQL databases and especially mongoDB?
If so, what can we do to protect us from them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅 MongoDB 文档:
还有其他问题需要注意,因此值得阅读该页面。
See MongoDB's documentation:
There are other issues to be aware of, so it's worth giving that page a read.
该文档是错误的,在 PHP 中,您需要小心空字节注入攻击(http://www.idontplaydarts.com/2011/02/mongodb-null -byte-injection-attacks/)以及对象注入(http://www.idontplaydarts.com/2010/07/mongodb-is-vulnerable-to-sql-injection-in-php-at-least/)
The documentation is wrong, In PHP you need to be careful of null-byte injection attacks (http://www.idontplaydarts.com/2011/02/mongodb-null-byte-injection-attacks/) as well as object injection (http://www.idontplaydarts.com/2010/07/mongodb-is-vulnerable-to-sql-injection-in-php-at-least/)