The Efficiency of Machine Learning Detection of NoSQL Injections in MongoDB
2025 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE credits
Student thesis
Abstract [en]
With the rising popularity of NoSQL in modern applications, finding a suitable security mechanism against NoSQL injection attacks has become increasingly important. There is a clear gap in researching NoSQL injections compared to regular SQL injections. The study investigates how machine learning models can be used to detect and mitigate NoSQL injections using the MongoDB Injection Dataset which consists of 400 benign and malicious queries. Five models were implemented, k-Nearest Neighbors, Logistic Regression, Naive Bayes, Neural Network and a Support Vector Machine. They were trained using vectorization, grid search and cross-validation. The k-Nearest Neighbors achieved the highest accuracy of 88.75%, whereas the Neural Network performed slightly worse, likely due to the relatively small dataset. A second experiment using 60 generated NoSQL injections from NoSQLMap achieved 100% detection using k-Nearest Neighbor. The experiment shows that machine learning can effectively improve security against NoSQL injections.
Place, publisher, year, edition, pages
2025. , p. 34
Series
UMNAD ; 1578
Keywords [en]
NoSQL injection, MongoDB, machine learning, k-nearest neighbors, logistic regression, naive bayes, neural network, support vector machine
National Category
Computer Sciences
Identifiers
URN: urn:nbn:se:umu:diva-242942OAI: oai:DiVA.org:umu-242942DiVA, id: diva2:1988394
Educational program
Bachelor of Science Programme in Computing Science
Presentation
2025-06-03, NAT.D.470, Umeå, 14:30 (Swedish)
Examiners
2025-08-122025-08-112025-08-12Bibliographically approved