CVE-2021-23408: Graphhopper web bundle Prototype Pollution Vulnerability

MODERATE
Advisory Identifier: GHSA-qhxh-9hhx-6p7v
CVSS 5.4
CWE-1321
Published
Advisory Summary

CVE-2021-23408 is a MODERATE (CVSS 5.4) prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Graphhopper web bundle libraries in the Maven ecosystem. The issue involves prototype pollution in graphhopper. Remediation is available by upgrading affected packages to version 3.2.

CVE-2021-23408 at a Glance

CVE Identifier CVE-2021-23408
GHSA Identifier GHSA-qhxh-9hhx-6p7v
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product Graphhopper web bundle
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.4

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:R/S:U/C:L/I:N/A:L).

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

How to Fix CVE-2021-23408

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

com.graphhopper:graphhopper-web-bundle fixed: 3.2
<dependency>
    <groupId>com.graphhopper</groupId>
    <artifactId>graphhopper-web-bundle</artifactId>
    <version>3.2</version>
</dependency>
Verify Direct and Transitive Dependencies

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

mvn dependency:tree -Dincludes=com.graphhopper

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2021-23408, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=com.graphhopper

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

Note: The mvn dependency:tree -Dincludes=com.graphhopper command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

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 Graphhopper web bundle, 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 the package `com.graphhopper:graphhopper-web-bundle` before 3.2, from 4.0-pre1 and before 4.0. The URL parser could be tricked into adding or modifying properties of Object.prototype using a constructor or __proto__ payload.

CVE-2021-23408 Affected Graphhopper web bundle Versions

1 component(s)
Fixed Versions:
3.2
Product / Package Ecosystem Affected Versions Fixed Version
com.graphhopper:graphhopper-web-bundle
Maven
< 3.2
3.2

References

Frequently Asked Questions

What is CVE-2021-23408?
CVE-2021-23408 is a security vulnerability in Graphhopper web bundle involving Prototype Pollution in GraphHopper under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which Graphhopper web bundle versions are affected?
Affected versions include releases prior to 3.2 across affected packages: com.graphhopper:graphhopper-web-bundle.
What version fixes CVE-2021-23408?
Upgrading to 3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is graphhopper-web-bundle affected?
Yes, com.graphhopper:graphhopper-web-bundle is affected in releases prior to 3.2. Upgrade your dependency to 3.2 or later.
What is the CVSS score of CVE-2021-23408?
CVE-2021-23408 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:L.
What CWE is associated with CVE-2021-23408?
CVE-2021-23408 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 Maven dependencies for CVE-2021-23408?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=com.graphhopper'. 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-qhxh-9hhx-6p7v",
  "modified" : "2021-07-26T17:47:03Z",
  "published" : "2021-08-02T16:59:35Z",
  "aliases" : [ "CVE-2021-23408" ],
  "summary" : "Prototype Pollution in GraphHopper",
  "details" : "This affects the package `com.graphhopper:graphhopper-web-bundle` before 3.2, from 4.0-pre1 and before 4.0. The URL parser could be tricked into adding or modifying properties of Object.prototype using a constructor or __proto__ payload.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "com.graphhopper:graphhopper-web-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23408"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/graphhopper/graphhopper/pull/2370"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/graphhopper/graphhopper/releases/tag/3.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/graphhopper/graphhopper/releases/tag/3.2"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JAVA-COMGRAPHHOPPER-1320114"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-07-26T17:47:03Z",
    "nvd_published_at" : "2021-07-21T16:15:00Z"
  }
}