Vulnerabilities in pkg:golang/github.com/evanphx/json-patch

PACKAGE
Advisory Identifier: GHSA-gxhv-3hwf-wjp9
Advisory Summary

CVE-2018-14632 is a HIGH (CVSS 7.7) json-patch out-of-bounds write vulnerability vulnerability (CWE-787: Out-of-bounds Write) affecting Github.com/evanphx/json patch libraries in the Go ecosystem. The issue involves json-patch out-of-bounds write vulnerability. Remediation is available by upgrading affected packages to version 0.5.2, 3.0.1-0.20180525145409-4c9aadca8f89.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/evanphx/json-patch

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/evanphx/json-patch. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-gxhv-3hwf-wjp9 CVE-2018-14632 HIGH JSON-Patch Out-of-bounds Write vulnerability

CVE-2018-14632 at a Glance

CVE Identifier CVE-2018-14632
GHSA Identifier GHSA-gxhv-3hwf-wjp9
Severity HIGH
CVSS v3.1 Base Score 7.7
CWE Classification CWE-787: Out-of-bounds Write
Affected Product Github.com/evanphx/json patch
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.7

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

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

How to Fix CVE-2018-14632

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

github.com/evanphx/json-patch fixed: 0.5.2
Upgrade github.com/evanphx/json-patch to 0.5.2
github.com/evanphx/json-patch fixed: 3.0.1-0.20180525145409-4c9aadca8f89
Upgrade github.com/evanphx/json-patch to 3.0.1-0.20180525145409-4c9aadca8f89
Verify Direct and Transitive Dependencies

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

inspect dependencies for github.com/evanphx/json-patch

How to Check if You Are Affected

To determine whether your application is affected by CVE-2018-14632, inspect your project dependencies for Github.com/evanphx/json patch:

inspect dependencies for github.com/evanphx/json-patch

Analyze the terminal output to locate any version of Github.com/evanphx/json patch in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-787: Out-of-bounds Write, where the product writes data past the end, or before the beginning, of the intended buffer. In Github.com/evanphx/json patch, 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

An out of bound write can occur when patching an Openshift object using the `oc patch` functionality in OpenShift Container Platform before 3.7. An attacker can use this flaw to cause a denial of service attack on the Openshift master api service which provides cluster management.

CVE-2018-14632 Affected Github.com/evanphx/json patch Versions

2 component(s)
Fixed Versions:
0.5.23.0.1-0.20180525145409-4c9aadca8f89
Product / Package Ecosystem Affected Versions Fixed Version
github.com/evanphx/json-patch
Go
< 0.5.2
0.5.2
github.com/evanphx/json-patch
Go
≥ 3.0.0
< 3.0.1-0.20180525145409-4c9aadca8f89
3.0.1-0.20180525145409-4c9aadca8f89

References

Frequently Asked Questions

What is CVE-2018-14632?
CVE-2018-14632 is a security vulnerability in Github.com/evanphx/json patch involving JSON-Patch Out-of-bounds Write vulnerability under CWE-787: Out-of-bounds Write.
Which Github.com/evanphx/json patch versions are affected?
Affected versions include releases prior to 0.5.2, 3.0.1-0.20180525145409-4c9aadca8f89 across affected packages: github.com/evanphx/json-patch.
What version fixes CVE-2018-14632?
Upgrading to 0.5.2, 3.0.1-0.20180525145409-4c9aadca8f89 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/evanphx/json-patch affected?
Yes, github.com/evanphx/json-patch is affected in releases prior to 0.5.2, 3.0.1-0.20180525145409-4c9aadca8f89. Upgrade your dependency to 0.5.2, 3.0.1-0.20180525145409-4c9aadca8f89 or later.
What is the CVSS score of CVE-2018-14632?
CVE-2018-14632 has a CVSS v3.1 base score of 7.7 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:H.
What CWE is associated with CVE-2018-14632?
CVE-2018-14632 is classified under CWE-787: Out-of-bounds Write (The product writes data past the end, or before the beginning, of the intended buffer.).
How can I check Go dependencies for CVE-2018-14632?
Run the dependency tree command: 'inspect dependencies for github.com/evanphx/json-patch'. 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-gxhv-3hwf-wjp9",
  "modified" : "2023-02-08T00:27:34Z",
  "published" : "2022-05-13T01:34:31Z",
  "aliases" : [ "CVE-2018-14632" ],
  "summary" : "JSON-Patch Out-of-bounds Write vulnerability",
  "details" : "An out of bound write can occur when patching an Openshift object using the `oc patch` functionality in OpenShift Container Platform before 3.7. An attacker can use this flaw to cause a denial of service attack on the Openshift master api service which provides cluster management.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/evanphx/json-patch"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/evanphx/json-patch"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.0.1-0.20180525145409-4c9aadca8f89"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-14632"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/evanphx/json-patch/pull/57"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/evanphx/json-patch/commit/4c9aadca8f89e349c999f04e28199e96e81aba03"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/evanphx/json-patch/commit/4c9aadca8f89e349c999f04e28199e96e81aba03#diff-65c563bba473be9d94ce4d033f74810e"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHBA-2018:2652"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2654"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2709"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2906"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2908"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-14632"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/evanphx/json-patch"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2021-0076"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-787" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-08T00:27:34Z",
    "nvd_published_at" : "2018-09-06T14:29:00Z"
  }
}