GHSA-rc4v-99cr-pjcm: @seal security/mongoose fixed Prototype Pollution Vulnerability

CRITICAL
CVSS 10.0
CWE-1321
Published
Advisory Summary

GHSA-rc4v-99cr-pjcm is a CRITICAL (CVSS 10.0) prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting @seal security/mongoose fixed libraries in the npm ecosystem. The issue involves prototype pollution in ali-security/mongoose. Remediation is available by upgrading affected packages to version 5.3.4.

GHSA-rc4v-99cr-pjcm at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-rc4v-99cr-pjcm
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product @seal security/mongoose fixed
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability High (A:H)

How to Fix GHSA-rc4v-99cr-pjcm

To remediate this vulnerability, upgrade all affected @seal security/mongoose fixed dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@seal-security/mongoose-fixed fixed: 5.3.4
npm install @seal-security/mongoose-fixed@5.3.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @seal-security/mongoose-fixed

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-rc4v-99cr-pjcm, inspect your project dependencies using npm:

npm ls @seal-security/mongoose-fixed

Analyze the terminal output to locate any version of @seal security/mongoose fixed in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.3.4), your application is affected.

Note: The npm ls @seal-security/mongoose-fixed command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In @seal security/mongoose fixed, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact This vulnerability causes a Prototype Pollution in document.js, through functions such as findByIdAndUpdate(). For applications using Express and EJS, this can potentially allow remote code execution. ### Patches The original patched version for mongoose 5.3.3 did not include a fix for CVE-2023-3696. Therefore the existing version @seal-security/mongoose-fixed version 5.3.3 is affected by this vulnerability (though it is protected from CVE-2022-2564 and CVE-2019-17426). To mitigate this issue, a @seal-security/mongoose-fixed version 5.3.4 has been deployed. Note that this version is compatible with the original mongoose version 5.3.3, not version 5.3.4 ### References https://security.snyk.io/vuln/SNYK-JS-MONGOOSE-5777721 https://github.com/advisories/GHSA-9m93-w8w6-76hh https://github.com/Automattic/mongoose/commit/f1efabf350522257364aa5c2cb36e441cf08f1a2

GHSA-rc4v-99cr-pjcm Affected @seal security/mongoose fixed Versions

1 component(s)
Fixed Versions:
5.3.4
Product / Package Ecosystem Affected Versions Fixed Version
@seal-security/mongoose-fixed
npm
≥ 5.3.3
< 5.3.4
All 1 versions
5.3.3
5.3.4

References

Frequently Asked Questions

What is GHSA-rc4v-99cr-pjcm?
GHSA-rc4v-99cr-pjcm is a security vulnerability in @seal security/mongoose fixed involving Prototype Pollution in ali-security/mongoose under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which @seal security/mongoose fixed versions are affected?
Affected versions include releases prior to 5.3.4 across affected packages: @seal-security/mongoose-fixed.
What version fixes GHSA-rc4v-99cr-pjcm?
Upgrading to 5.3.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @seal-security/mongoose-fixed affected?
Yes, @seal-security/mongoose-fixed is affected in releases prior to 5.3.4. Upgrade your dependency to 5.3.4 or later.
What is the CVSS score of GHSA-rc4v-99cr-pjcm?
GHSA-rc4v-99cr-pjcm has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:H.
What CWE is associated with GHSA-rc4v-99cr-pjcm?
GHSA-rc4v-99cr-pjcm is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.).
How can I check npm dependencies for GHSA-rc4v-99cr-pjcm?
Run the dependency tree command: 'npm ls @seal-security/mongoose-fixed'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rc4v-99cr-pjcm",
  "modified" : "2023-10-17T14:21:16Z",
  "published" : "2023-10-17T14:21:16Z",
  "aliases" : [ ],
  "summary" : "Prototype Pollution in ali-security/mongoose",
  "details" : "### Impact\nThis vulnerability causes a Prototype Pollution in document.js, through functions such as findByIdAndUpdate().\nFor applications using Express and EJS, this can potentially allow remote code execution.\n\n### Patches\nThe original patched version for mongoose 5.3.3 did not include a fix for CVE-2023-3696. Therefore the existing version @seal-security/mongoose-fixed version 5.3.3 is affected by this vulnerability (though it is protected from CVE-2022-2564 and CVE-2019-17426). To mitigate this issue, a @seal-security/mongoose-fixed version 5.3.4 has been deployed. Note that this version is compatible with the original mongoose version 5.3.3, not version 5.3.4\n\n### References\nhttps://security.snyk.io/vuln/SNYK-JS-MONGOOSE-5777721\nhttps://github.com/advisories/GHSA-9m93-w8w6-76hh\nhttps://github.com/Automattic/mongoose/commit/f1efabf350522257364aa5c2cb36e441cf08f1a2\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@seal-security/mongoose-fixed"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.3.3"
      }, {
        "fixed" : "5.3.4"
      } ]
    } ],
    "versions" : [ "5.3.3" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ali-security/mongoose/security/advisories/GHSA-rc4v-99cr-pjcm"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Automattic/mongoose/commit/f1efabf350522257364aa5c2cb36e441cf08f1a2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ali-security/mongoose"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JS-MONGOOSE-5777721"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-10-17T14:21:16Z",
    "nvd_published_at" : null
  }
}