Flaws in a popular dev library could let hackers run malicious code in your MongoDB database
A popular third party library of MongoDB could allow attackers to execute malicious code on your server
A researcher has uncovered two related vulnerabilities in a popular developer library used to connect applications and MongoDB that could allow hackers to sneak into your database.
Mongoose is an object data modeling (ODM) library for MongoDB that connects it to the Node.js runtime environment, essentially simplifying interactions between applications and MongoDB databases
The flaws were discovered by Dat Phung, a member of OPSWAT’s fellowship program, who chose examining Mongoose due to its widespread use in production environments.
OPSWAT explained the potential severity of the flaws in a blog, noting the number of businesses that use Mongoose for their MongoDB databases.
“Many businesses use Mongoose and MongoDB to build their apps. If hackers break in, they could cause serious functionality problems and, worse, put critical data at risk of theft, manipulation, or destruction.”
During his analysis, Phung discovered CVE-2024-53900, a remote code execution (RCE) flaw that exploits Mongoose’s $where operator that enables JavaScript execution directory on the MongoDB server.
Phung warned that the flaw could be used by attackers to query the database to run malicious commands on the Node.js application server, which thereafter could allow them to steal data or even take control of part of the application itself.
Sign up today and you will receive a free copy of our Future Focus 2026 report - the leading resource for IT decision-maker insight on priorities and investment areas in AI, security and more.
He submitted a security report disclosing the flaw to Snyk on 7 November and Mongoose released a new version of 8.8.3 which addressed the issue later that month.
But when Phung took a closer look at the patch he found a potential bypass that would still enable RCE on the application server.
With the new flaw, CVE-2025-23061, Phung demonstrated that by nesting the $where operator inside an $or clause, he was able to bypass the new single-level checks introduced by Mongoose to mitigate CVE-2024-53900 and achieve RCE.
RELATED WHITEPAPER
The proof-of-concept exploit developed by Phung showed that CVE-2025-23061, which was assigned a 9.0 severity rating under the MITRE framework, could be triggered in Mongoose versions prior to 8.9.5 (later than 8.8.3) and disclosed the new vulnerability via Tidelift.
OPSWAT warned that these vulnerabilities could be exploited by attackers to embed malicious code inside the organization's MongoDB database, as well as steal or corrupt data stored in MongoDB.
It advised businesses to update their instances of Mongoose immediately to the latest version immediately.
MORE FROM ITPRO
- Open source vulnerabilities dominated 2023, and this year looks no different
- Open source malware surged by 156% in 2024
- The Zservers takedown is another big win for law enforcement
Solomon Klappholz is a former staff writer for ITPro and ChannelPro. He has experience writing about the technologies that facilitate industrial manufacturing, which led to him developing a particular interest in cybersecurity, IT regulation, industrial infrastructure applications, and machine learning.
-
AI is crucial to infrastructure and IT operations but only if it's done right, Gartner report saysNews Report suggests there are five AI trends worth adopting if firms want to improve operational efficiency with AI and optimize costs
-
Thales Imperva Cloud WAFReviews Sophisticated web application firewall that's a breeze to deploy, packed with sophisticated security features, and ideally suited to enterprises
-
IBM and Red Hat report hundreds of open source fixes with Lightwell Clearinghouse schemeNews Lightwell Clearinghouse is now generally available, allowing firms to request priority review and remediations for open source software
-
‘This pause is due to a significant rise in automated submissions, the vast majority of which are not valid’: Google pauses open source bug bounty scheme over AI slop submissionsNews The Google open source scheme is the latest bug bounty to fall victim to AI-generated submissions
-
Huawei reiterates its commitment to open source standards at Connect 2026News The Chinese IT giant is the latest to declare open source a key element of AI
-
Red Hat launches new open source project to drive AI governanceNews The asago open source project will allow enterprises to automate compliance processes and bolster security
-
Amazon targets agent safety gains with investment in team behind Lean programming languageNews The tech giant hopes support for the open source programming language could drive AI agent safety improvements
-
‘These Chinese models are excellent’: Nvidia CEO Jensen Huang hails powerful new Chinese AI models like Kimi K3 – and says don’t be put off by security ‘misconceptions’News As powerful new AI models like Kimi K3 hit the market, Huang says competition will be a positive for the global industry
-
Apple is speeding up software patching due to AI security concerns – here’s what you need to knowNews Apple is speeding up its software patching processes amid rising concerns that AI is helping hackers to spot and exploit flaws at a far quicker pace.
-
The UK is betting big on the power of open source AINews The government wants to encourage open source developers to help improve public services