A practical challenge that demonstrates how a poorly filtered NoSQL query parameter enables attackers to enumerate and leak sensitive product information from a MongoDB-backed e-commerce site.
- Detect and confirm NoSQL injection via error-based probing
- Exploit boolean logic injections to bypass category filters
- Extract sensitive, unreleased product data from the application
Intermediate
45 minutes
- Burp Suite or an intercepting proxy
- Basic knowledge of JavaScript and MongoDB query syntax
- Familiarity with web application testing
- Detecting and confirming NoSQL injections
- Constructing and encoding MongoDB operator payloads
- Leveraging injections to access unauthorized data
├── build/ # Application source code
├── deploy/ # Docker deployment files
├── test/ # Automated tests
├── docs/ # Documentation
├── README.md # This file
└── .gitignore # Git ignore rules
Docker and Docker Compose installed on your machine.
- Clone the repository
- Run
docker-compose up --build
in the project directory - Access the lab interface at http://localhost:3206
This project includes automated Docker Hub deployment via GitHub Actions. The workflow will build and push the Docker image to Docker Hub on every push to main/master branch or when tags are created.
To enable Docker Hub deployment, you need to configure the following secrets in your GitHub repository:
- Go to your repository Settings → Secrets and variables → Actions
- Add the following repository secrets:
DOCKER_USER
: Your Docker Hub usernameDOCKER_PAT
: Your Docker Hub Personal Access Token (not your password)
- Log in to Docker Hub
- Go to Account Settings → Security
- Click "New Access Token"
- Give it a name (e.g., "GitHub Actions")
- Copy the token and save it as the
DOCKER_PAT
secret
Once the workflow runs successfully, you can pull and run the image:
docker pull your-dockerhub-username/nosql_injection_lab_flask:latest
docker run -p 3206:5000 your-dockerhub-username/nosql_injection_lab_flask:latest
Note: You'll still need to run MongoDB separately or use the docker-compose file for the complete setup.
https://github.com/example-org/nosql-injection-lab/issues
This is a deliberately vulnerable lab designed solely for educational purposes.