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

  • SEARCH
  • Home
  • 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 8279545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:22:45+00:00 2026-06-08T09:22:45+00:00

If you bind an api call to the object’s id, could one simply brute

  • 0

If you bind an api call to the object’s id, could one simply brute force this api to get all objects? If you think of MySQL, this would be totally possible with incremental integer ids. But what about MongoDB? Are the ids guessable? For example, if you know one id, is it easy to guess other (next, previous) ids?

Thanks!

  • 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-08T09:22:46+00:00Added an answer on June 8, 2026 at 9:22 am

    Update Jan 2019: As mentioned in the comments, the information below is true up until version 3.2. Version 3.4+ changed the spec so that machine ID and process ID were merged into a single random 5 byte value instead. That might make it harder to figure out where a document came from, but it also simplifies the generation and reduces the likelihood of collisions.

    Original Answer:

    +1 for Sergio’s answer, in terms of answering whether they could be guessed or not, they are not hashes, they are predictable, so they can be “brute forced” given enough time. The likelihood depends on how the ObjectIDs were generated and how you go about guessing. To explain, first, read the spec here:

    Object ID Spec

    Let us then break it down piece by piece:

    • TimeStamp – completely predictable as long as you have a general idea of when the data was generated
    • Machine – this is an MD5 hash of one of several options, some of which are more easily determined than others, but highly dependent on the environment
    • PID – again, not a huge number of values here, and could be sleuthed for data generated from a known source
    • Increment – if this is a random number rather than an increment (both are allowed), then it is less predictable

    To expand a bit on the sources. ObjectIDs can be generated by:

    • MongoDB itself (but can be migrated, moved, updated)
    • The driver (on any machine that inserts or updates data)
    • Your Application (you can manually insert your own ObjectID if you wish)

    So, there are things you can do to make them harder to guess individually, but without a lot of forethought and safeguards, for a normal data set, the ranges of valid ObjectIDs should be fairly easy to work out since they are all prefixed with a timestamp (unless you are manipulating this in some way).

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

Sidebar

Related Questions

In V2 of the Google Maps API, you could bind map events to a
Does jQuery provides a API to call functions binding the this variable to the
I'm using Luabind to bind a C++ API to Lua. I have some objects
From the bind() jQuery API: As of jQuery 1.7, the .on() method is the
boost::bind overloads several operators for its placeholders: For convenience, the function objects produced by
I was looking at a blog about good API design link text In one
I connected with VPN to setup the inventory API to get product list and
I'm trying to make this call to send data to the server: $.ajax({ type:
How can I bind arguments to a Python function so that I can call
So here is my code: $(document).ready( function() { $('#form').bind('change', function(){ $.ajax({ type: 'get', url:

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.