Skip to content
Prototype pollution Disclosed report Intermediate CVE-2022-2564

automattic/mongoose vulnerable to Prototype pollution via Schema.path

The Schema.path() function in Mongoose allows modification of the Object prototype when setting the schema object. This could be exploited to cause a denial of service.

Automattic/mongoose

Originally disclosed on huntr

Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Affected versions of this package are vulnerable to Prototype Pollution. The Schema.path() function is vulnerable to prototype pollution when setting the schema object. This vulnerability allows modification of the Object prototype and could be manipulated into a Denial of Service (DoS) attack.

From the GitHub Advisory Database (GHSA-f825-f98c-gj3g, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

This vulnerability allows modification of the Object prototype and could be manipulated into a Denial of Service (DoS) attack.

What the attacker needed

Ability to call Schema.path() with crafted input

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Prototype pollution is a bug where an attacker can add or change properties on a basic JavaScript object that many other objects inherit from. In this case, a function in Mongoose lets someone modify that shared prototype, which can break the application and lead to a denial of service, meaning the app stops working properly.

What is Prototype pollution?

Input changes JavaScript's shared object prototype, altering behaviour across the application, sometimes to XSS or code execution.

More from Automattic/mongoose

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Prototype pollution

The lesson behind this report.

Input changes JavaScript's shared object prototype, altering behaviour across the application, sometimes to XSS or code execution.