How to avoid the problem of MongoDB injection effectively

Source: Internet
Author: User
Tags mongodb injection
SQL injection is a common problem in relational databases and is uncommon in non-relational databases.

In the article "Security Alert, a simple MongoDB injection", the paper describes the injection problem of MongoDB under PHP.

So, is there such a problem in other languages (like Python, Nodejs)?
Do they have a generic test and avoid the injection method?

Reply content:

SQL injection is a common problem in relational databases and is uncommon in non-relational databases.

In the article "Security Alert, a simple MongoDB injection", the paper describes the injection problem of MongoDB under PHP.

So, is there such a problem in other languages (like Python, Nodejs)?
Do they have a generic test and avoid the injection method?

And the way to prevent SQL injection

Do not trust any user's input, including cookies

Convert, Escape

An easy way to prevent injection is not to expose the raw query to the external part, you can use the ORM framework, or define a set of query mapping rules

Only the programmer is more reliable! There's no other way.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.