Vulnerabilities in pkg:npm/mxgraph

PACKAGE
Advisory Identifier: GHSA-wvpv-8524-wg6x
Advisory Summary

CVE-2017-18197 is a CRITICAL (CVSS 9.8) mxgraph vulnerable to xxe attacks vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Mxgraph libraries in the npm ecosystem. The issue involves mxgraph vulnerable to xxe attacks. Remediation is available by upgrading affected packages to version 3.7.6.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/mxgraph

3 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/mxgraph. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-wvpv-8524-wg6x CVE-2017-18197 CRITICAL mxGraph vulnerable to XXE attacks
GHSA-j4rv-pr9g-q8jv CVE-2022-40440 MODERATE mxGraph vulnerable to cross-site scripting in setTooltips function
GHSA-xm59-jvxm-cp3v CVE-2019-13127 MODERATE mxGraph vulnerable to cross-site scripting in color field

CVE-2017-18197 at a Glance

CVE Identifier CVE-2017-18197
GHSA Identifier GHSA-wvpv-8524-wg6x
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Mxgraph
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2017-18197

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

mxgraph fixed: 3.7.6
npm install mxgraph@3.7.6
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 mxgraph

How to Check if You Are Affected

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

npm ls mxgraph

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

Note: The npm ls mxgraph 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-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Mxgraph, 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

In `mxGraphViewImageReader.java` in mxGraph before 3.7.6, the `SAXParserFactory` instance in `convert()` is missing flags to prevent XML External Entity (XXE) attacks, as demonstrated by `/ServerView`.

CVE-2017-18197 Affected Mxgraph Versions

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

References

Frequently Asked Questions

What is CVE-2017-18197?
CVE-2017-18197 is a security vulnerability in Mxgraph involving mxGraph vulnerable to XXE attacks under CWE-611: Improper Restriction of XML External Entity Reference.
Which Mxgraph versions are affected?
Affected versions include releases prior to 3.7.6 across affected packages: mxgraph.
What version fixes CVE-2017-18197?
Upgrading to 3.7.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mxgraph affected?
Yes, mxgraph is affected in releases prior to 3.7.6. Upgrade your dependency to 3.7.6 or later.
What is the CVSS score of CVE-2017-18197?
CVE-2017-18197 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2017-18197?
CVE-2017-18197 is classified under CWE-611: Improper Restriction of XML External Entity Reference (The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.).
How can I check npm dependencies for CVE-2017-18197?
Run the dependency tree command: 'npm ls mxgraph'. 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-wvpv-8524-wg6x",
  "modified" : "2023-10-19T19:08:39Z",
  "published" : "2022-05-14T03:38:59Z",
  "aliases" : [ "CVE-2017-18197" ],
  "summary" : "mxGraph vulnerable to XXE attacks",
  "details" : "In `mxGraphViewImageReader.java` in mxGraph before 3.7.6, the `SAXParserFactory` instance in `convert()` is missing flags to prevent XML External Entity (XXE) attacks, as demonstrated by `/ServerView`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mxgraph"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.7.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-18197"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jgraph/mxgraph/issues/124"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jgraph/mxgraph/commit/97b3718db64a6ca9afb3382de2926eb8da660052"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jgraph/mxgraph"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2018/03/msg00002.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-10-19T19:08:39Z",
    "nvd_published_at" : "2018-02-24T02:29:00Z"
  }
}