CVE-2022-21213: Mout Prototype Pollution Vulnerability

HIGH
Advisory Identifier: GHSA-vvv8-xw5f-3f88
CVSS 7.5
CWE-1321
Published
Advisory Summary

CVE-2022-21213 is a HIGH (CVSS 7.5) prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Mout libraries in the npm ecosystem. The issue involves prototype pollution in mout. Remediation is available by upgrading affected packages to version 1.2.4.

CVE-2022-21213 at a Glance

CVE Identifier CVE-2022-21213
GHSA Identifier GHSA-vvv8-xw5f-3f88
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product Mout
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:U/C:N/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 Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2022-21213

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

mout fixed: 1.2.4
npm install mout@1.2.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 mout

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2022-21213, inspect your project dependencies using npm:

npm ls mout

Analyze the terminal output to locate any version of Mout in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.4), your application is affected.

Note: The npm ls mout 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 Mout, 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

This affects all versions of package mout. The deepFillIn function can be used to 'fill missing properties recursively', while the deepMixIn mixes objects into the target object, recursively mixing existing child objects as well. In both cases, the key used to access the target object recursively is not checked, leading to exploiting this vulnerability. **Note:** This vulnerability derives from an incomplete fix of [CVE-2020-7792](https://security.snyk.io/vuln/SNYK-JS-MOUT-1014544).

CVE-2022-21213 Affected Mout Versions

1 component(s)
Fixed Versions:
1.2.4
Product / Package Ecosystem Affected Versions Fixed Version
mout
npm
< 1.2.4
1.2.4

References

Frequently Asked Questions

What is CVE-2022-21213?
CVE-2022-21213 is a security vulnerability in Mout involving Prototype Pollution in mout under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which Mout versions are affected?
Affected versions include releases prior to 1.2.4 across affected packages: mout.
What version fixes CVE-2022-21213?
Upgrading to 1.2.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mout affected?
Yes, mout is affected in releases prior to 1.2.4. Upgrade your dependency to 1.2.4 or later.
What is the CVSS score of CVE-2022-21213?
CVE-2022-21213 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-21213?
CVE-2022-21213 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 CVE-2022-21213?
Run the dependency tree command: 'npm ls mout'. 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-vvv8-xw5f-3f88",
  "modified" : "2022-06-20T22:33:58Z",
  "published" : "2022-06-18T00:00:20Z",
  "aliases" : [ "CVE-2022-21213" ],
  "summary" : "Prototype Pollution in mout",
  "details" : "This affects all versions of package mout. The deepFillIn function can be used to 'fill missing properties recursively', while the deepMixIn mixes objects into the target object, recursively mixing existing child objects as well. In both cases, the key used to access the target object recursively is not checked, leading to exploiting this vulnerability. **Note:** This vulnerability derives from an incomplete fix of [CVE-2020-7792](https://security.snyk.io/vuln/SNYK-JS-MOUT-1014544).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mout"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.2.3"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-21213"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mout/mout/pull/279"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mout/mout/commit/17ffdc2a96417a63a0147156dc045e90d0d14c64"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mout/mout"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mout/mout/blob/master/src/object/deepFillIn.js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mout/mout/blob/master/src/object/deepMixIn.js"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-MOUT-2342654"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-20T22:33:58Z",
    "nvd_published_at" : "2022-06-17T20:15:00Z"
  }
}