GHSA-74fp-r6jw-h4mp: K8s.io/apimachinery Kubernetes Apimachinery Packages Vulnerable To Vulnerability

HIGH
CVSS 7.5
CWE-776 CWE-20
Published
Advisory Summary

GHSA-74fp-r6jw-h4mp is a HIGH (CVSS 7.5) kubernetes apimachinery packages vulnerable to vulnerability (CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')) affecting K8s.io/apimachinery libraries in the Go ecosystem. The issue involves kubernetes apimachinery packages vulnerable to unbounded recursion in json or yaml parsing. Remediation is available by upgrading affected packages to version 0.0.0-20190927203648-9ce6eca90e73.

GHSA-74fp-r6jw-h4mp at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-74fp-r6jw-h4mp
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')
Affected Product K8s.io/apimachinery
Package Ecosystem Go
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 GHSA-74fp-r6jw-h4mp

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

k8s.io/apimachinery fixed: 0.0.0-20190927203648-9ce6eca90e73
Upgrade k8s.io/apimachinery to 0.0.0-20190927203648-9ce6eca90e73
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 k8s.io/apimachinery

How to Check if You Are Affected

To determine whether your application is affected by GHSA-74fp-r6jw-h4mp, inspect your project dependencies for K8s.io/apimachinery:

inspect dependencies for k8s.io/apimachinery

Analyze the terminal output to locate any version of K8s.io/apimachinery in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20190927203648-9ce6eca90e73), 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-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion'), where the product uses xml documents and allows their structure to be defined with a document type definition (dtd), but it does not properly control the number of recursive definitions of entities. In K8s.io/apimachinery, 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

CVE-2019-11253 is a denial of service vulnerability in the kube-apiserver, allowing authorized users sending malicious YAML or JSON payloads to cause kube-apiserver to consume excessive CPU or memory, potentially crashing and becoming unavailable. When creating a ConfigMap object which has recursive references contained in it, excessive CPU usage can occur. This appears to be an instance of a "Billion Laughs" attack which is quite well known as an XML parsing issue. Applying this manifest to a cluster causes the client to hang for some time with considerable CPU usage. ```yaml apiVersion: v1 data: a: &a ["web","web","web","web","web","web","web","web","web"] b: &b [*a,*a,*a,*a,*a,*a,*a,*a,*a] c: &c [*b,*b,*b,*b,*b,*b,*b,*b,*b] d: &d [*c,*c,*c,*c,*c,*c,*c,*c,*c] e: &e [*d,*d,*d,*d,*d,*d,*d,*d,*d] f: &f [*e,*e,*e,*e,*e,*e,*e,*e,*e] g: &g [*f,*f,*f,*f,*f,*f,*f,*f,*f] h: &h [*g,*g,*g,*g,*g,*g,*g,*g,*g] i: &i [*h,*h,*h,*h,*h,*h,*h,*h,*h] kind: ConfigMap metadata: name: yaml-bomb namespace: default ``` ### Specific Go Packages Affected - k8s.io/apimachinery/pkg/runtime/serializer/json - k8s.io/apimachinery/pkg/util/json

GHSA-74fp-r6jw-h4mp Affected K8s.io/apimachinery Versions

1 component(s)
Fixed Versions:
0.0.0-20190927203648-9ce6eca90e73
Product / Package Ecosystem Affected Versions Fixed Version
k8s.io/apimachinery
Go
< 0.0.0-20190927203648-9ce6eca90e73
0.0.0-20190927203648-9ce6eca90e73

References

Frequently Asked Questions

What is GHSA-74fp-r6jw-h4mp?
GHSA-74fp-r6jw-h4mp is a security vulnerability in K8s.io/apimachinery involving Kubernetes apimachinery packages vulnerable to unbounded recursion in JSON or YAML parsing under CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion').
Which K8s.io/apimachinery versions are affected?
Affected versions include releases prior to 0.0.0-20190927203648-9ce6eca90e73 across affected packages: k8s.io/apimachinery.
What version fixes GHSA-74fp-r6jw-h4mp?
Upgrading to 0.0.0-20190927203648-9ce6eca90e73 (or the latest patched release for your respective branch) resolves the vulnerability.
Is k8s.io/apimachinery affected?
Yes, k8s.io/apimachinery is affected in releases prior to 0.0.0-20190927203648-9ce6eca90e73. Upgrade your dependency to 0.0.0-20190927203648-9ce6eca90e73 or later.
What is the CVSS score of GHSA-74fp-r6jw-h4mp?
GHSA-74fp-r6jw-h4mp 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 GHSA-74fp-r6jw-h4mp?
GHSA-74fp-r6jw-h4mp is classified under CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion') (The product uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.).
How can I check Go dependencies for GHSA-74fp-r6jw-h4mp?
Run the dependency tree command: 'inspect dependencies for k8s.io/apimachinery'. 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-74fp-r6jw-h4mp",
  "modified" : "2024-05-20T21:45:20Z",
  "published" : "2023-02-08T00:35:27Z",
  "aliases" : [ ],
  "summary" : "Kubernetes apimachinery packages vulnerable to unbounded recursion in JSON or YAML parsing",
  "details" : "CVE-2019-11253 is a denial of service vulnerability in the kube-apiserver, allowing authorized users sending malicious YAML or JSON payloads to cause kube-apiserver to consume excessive CPU or memory, potentially crashing and becoming unavailable. \n\nWhen creating a ConfigMap object which has recursive references contained in it, excessive CPU usage can occur. This appears to be an instance of a \"Billion Laughs\" attack which is quite well known as an XML parsing issue.\n\nApplying this manifest to a cluster causes the client to hang for some time with considerable CPU usage.\n\n```yaml\napiVersion: v1\ndata:\n  a: &a [\"web\",\"web\",\"web\",\"web\",\"web\",\"web\",\"web\",\"web\",\"web\"]\n  b: &b [*a,*a,*a,*a,*a,*a,*a,*a,*a]\n  c: &c [*b,*b,*b,*b,*b,*b,*b,*b,*b]\n  d: &d [*c,*c,*c,*c,*c,*c,*c,*c,*c]\n  e: &e [*d,*d,*d,*d,*d,*d,*d,*d,*d]\n  f: &f [*e,*e,*e,*e,*e,*e,*e,*e,*e]\n  g: &g [*f,*f,*f,*f,*f,*f,*f,*f,*f]\n  h: &h [*g,*g,*g,*g,*g,*g,*g,*g,*g]\n  i: &i [*h,*h,*h,*h,*h,*h,*h,*h,*h]\nkind: ConfigMap\nmetadata:\n  name: yaml-bomb\n  namespace: default\n```\n### Specific Go Packages Affected\n- k8s.io/apimachinery/pkg/runtime/serializer/json\n- k8s.io/apimachinery/pkg/util/json\n",
  "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" : "Go",
      "name" : "k8s.io/apimachinery"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20190927203648-9ce6eca90e73"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-11253"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kubernetes/kubernetes/issues/83253"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kubernetes/kubernetes/pull/83261"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-pmqp-h87c-mr78"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kubernetes/kubernetes"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/g/kubernetes-security-announce/c/jk8polzSUxs"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-0965"
  }, {
    "type" : "WEB",
    "url" : "https://stackoverflow.com/questions/58129150/security-yaml-bomb-user-can-restart-kube-api-by-sending-configmap"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-776" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-08T00:35:27Z",
    "nvd_published_at" : null
  }
}