CVE-2020-35149: Mquery Code Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-45q2-34rf-mr94
CVSS 5.3
CWE-94
Published
Advisory Summary

CVE-2020-35149 is a MODERATE (CVSS 5.3) code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Mquery libraries in the npm ecosystem. The issue involves code injection in mquery. Remediation is available by upgrading affected packages to version 3.2.3.

CVE-2020-35149 at a Glance

CVE Identifier CVE-2020-35149
GHSA Identifier GHSA-45q2-34rf-mr94
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Mquery
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:L/A:N).

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 Low (I:L)
Availability None (A:N)

How to Fix CVE-2020-35149

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

mquery fixed: 3.2.3
npm install mquery@3.2.3
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 mquery

How to Check if You Are Affected

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

npm ls mquery

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

Note: The npm ls mquery 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Mquery, 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

lib/utils.js in mquery before 3.2.3 allows a pollution attack because a special property (e.g., __proto__) can be copied during a merge or clone operation.

CVE-2020-35149 Affected Mquery Versions

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

References

Frequently Asked Questions

What is CVE-2020-35149?
CVE-2020-35149 is a security vulnerability in Mquery involving Code Injection in mquery under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Mquery versions are affected?
Affected versions include releases prior to 3.2.3 across affected packages: mquery.
What version fixes CVE-2020-35149?
Upgrading to 3.2.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mquery affected?
Yes, mquery is affected in releases prior to 3.2.3. Upgrade your dependency to 3.2.3 or later.
What is the CVSS score of CVE-2020-35149?
CVE-2020-35149 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2020-35149?
CVE-2020-35149 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2020-35149?
Run the dependency tree command: 'npm ls mquery'. 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-45q2-34rf-mr94",
  "modified" : "2020-12-17T22:54:00Z",
  "published" : "2020-12-18T18:23:43Z",
  "aliases" : [ "CVE-2020-35149" ],
  "summary" : "Code Injection in mquery",
  "details" : "lib/utils.js in mquery before 3.2.3 allows a pollution attack because a special property (e.g., __proto__) can be copied during a merge or clone operation.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mquery"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.2.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-35149"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aheckmann/mquery/commit/792e69fd0a7281a0300be5cade5a6d7c1d468ad4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-12-17T22:54:00Z",
    "nvd_published_at" : null
  }
}