Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8750323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:50:48+00:00 2026-06-13T12:50:48+00:00

when trying to make this question, i got this one it is using Java,

  • 0

when trying to make this question, i got this one it is using Java, and in the answer it gave a Ruby example, and it seems that the injection happens only when using Json? because i’ve an expose where i’ll try to compare between NoSQL and SQL and i was trying to said: be happy, nosql has no sql injection since it’s not sql …

can you please explain me:

  • how sql injection happens when using Python driver (pymongo).
  • how to avoid it.
  • the comparison using the old way sql injection using the comment in the login form.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:50:49+00:00Added an answer on June 13, 2026 at 12:50 pm

    There are a couple of concerns with injection in MongoDB:

    • $where JS injection – Building JavaScript functions from user input can result in a query that can behave differently to what you expect. JavaScript functions in general are not a responsible method to program MongoDB queries and it is highly recommended to not use them unless absolutely needed.
    • Operator injection – If you allow users to build (from the front) a $or or something they could easily manipulate this ability to change your queries. This of course does not apply if you just take data from a set of text fields and manually build a $or from that data.
    • JSON injection – Quite a few people recently have been trying to convert a full JSON document sent (saw this first in JAVA, ironically) from some client side source into a document for insertion into MongoDB. I shouldn’t need to even go into why this is bad. A JSON value for a field is fine since, of course, MongoDB is BSON.

    As @Burhan stated injection comes from none sanitized input. Fortunately for MongoDB it has object orientated querying.

    The problem with SQL injection comes from the word “SQL”. SQL is a querying language built up of strings. On the other hand MongoDB actually uses a BSON document to specify a query (an Object). If you keep to the basic common sense rules I gave you above you should never have a problem with an attack vector like:

    SELECT * FROM tbl_user WHERE ='';DROP TABLE;
    

    Also MongoDB only supports one operation per command atm (without using eval, don’t ever do that though) so that wouldn’t work anyway…

    I should add that this does not apply to data validation only injection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
I'm trying to learn java better and I got one question. Say I got
This is my first question to this forum. I am trying to make this
I am trying to make this button using CSS3: But my button looks like
This is a re-work/new question after I got my previous one quite wrong by
I am trying to make this sample program work (defn foo ([x] (foo x
I'm trying to make this: 174,myfilename.jpg Into this on the php post process page:
I'm trying to make this regex ^(?!\-\-\sRoaming) to match with -- Roaming but it
I'm trying to make this request to the RunKeeper API : GET /user HTTP/1.1
I've been trying to make this script from ClearBox3 to stop conflicting with MooTools

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.