# CVE-2018-1002105: Privilege Escalation in Kubernetes

> Attackers can send arbitrary requests to backend servers via the Kubernetes API server, potentially executing code or escalating privileges.

- **Severity:** Critical 9.8 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Dec 2018
- **Updated:** 5 Aug 2024
- **Also known as:** DEBIAN-CVE-2018-1002105, GHSA-579h-mv94-g4gp, GO-2022-0792, RHSA-2018:3549, RHSA-2018:3551, RHSA-2018:3598, RHSA-2018:3624, RHSA-2018:3742, RHSA-2018:3752, RHSA-2018:3754

## What is CVE-2018-1002105?

CVE-2018-1002105 is a critical server-side request forgery vulnerability in Kubernetes Kubernetes, published on 5 Dec 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

In all Kubernetes versions prior to v1.10.11, v1.11.5, and v1.12.3, incorrect handling of error responses to proxied upgrade requests in the kube-apiserver allowed specially crafted requests to establish a connection through the Kubernetes API server to backend servers, then send arbitrary requests over the same connection directly to the backend, authenticated with the Kubernetes API server's TLS credentials used to establish the backend connection.

Weakness: CWE-388

## Which versions are affected by CVE-2018-1002105?

7 open source packages ship an affected version, including github.com/kubernetes/kubernetes. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/kubernetes/kubernetes` | Go | All versions | 1.10.11, 1.11.5, 1.12.3 |
| `github.com/kubernetes/kubernetes` | Go | All versions | 1.10.11 |
| `github.com/kubernetes/kubernetes` | Go | All versions | 1.10.11 |
| `github.com/kubernetes/kubernetes` | Go | From 1.11.0 | 1.11.5 |
| `github.com/kubernetes/kubernetes` | Go | From 1.11.0 | 1.11.5 |
| `github.com/kubernetes/kubernetes` | Go | From 1.12.0 | 1.12.3 |
| `github.com/kubernetes/kubernetes` | Go | From 1.12.0 | 1.12.3 |
| `atomic-enterprise-service-catalog` | Red Hat:openshift:3.10::el7 | All versions | 1:3.10.72-1.git.1450.7d3f435.el7 |
| `atomic-enterprise-service-catalog-svcat` | Red Hat:openshift:3.10::el7 | All versions | 1:3.10.72-1.git.1450.7d3f435.el7 |
| `atomic-openshift` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.0.3cb2fdc.el7 |
| `atomic-openshift-clients` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.0.3cb2fdc.el7 |
| `atomic-openshift-clients-redistributable` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.0.3cb2fdc.el7 |
| `atomic-openshift-descheduler` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.299.953c1c8.el7 |
| `atomic-openshift-docker-excluder` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.0.3cb2fdc.el7 |
| `atomic-openshift-dockerregistry` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.390.186ec4f.el7 |
| `atomic-openshift-excluder` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.0.3cb2fdc.el7 |
| `atomic-openshift-hyperkube` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.0.3cb2fdc.el7 |
| `atomic-openshift-hypershift` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.0.3cb2fdc.el7 |
| `atomic-openshift-master` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.0.3cb2fdc.el7 |
| `atomic-openshift-node` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.0.3cb2fdc.el7 |
| `atomic-openshift-node-problem-detector` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.252.fa9e8ae.el7 |
| `atomic-openshift-pod` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.0.3cb2fdc.el7 |
| `atomic-openshift-sdn-ovs` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.0.3cb2fdc.el7 |
| `atomic-openshift-template-service-broker` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.0.3cb2fdc.el7 |
| `atomic-openshift-tests` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.0.3cb2fdc.el7 |
| `atomic-openshift-web-console` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.395.d23c438.el7 |
| `golang-github-prometheus-node_exporter` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.1060.64daa26.el7 |
| `openshift-ansible` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.73-1.git.0.8b65cea.el7 |
| `openshift-ansible-docs` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.73-1.git.0.8b65cea.el7 |
| `openshift-ansible-playbooks` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.73-1.git.0.8b65cea.el7 |
| `openshift-ansible-roles` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.73-1.git.0.8b65cea.el7 |
| `openshift-enterprise-cluster-capacity` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.380.0fd53e8.el7 |
| `openshift-monitor-project-lifecycle` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.59.5358725.el7 |
| `openshift-monitor-sample-app` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.5.de405bc.el7 |
| `prometheus-node-exporter` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.72-1.git.1060.64daa26.el7 |
| `atomic-openshift` | Red Hat:openshift:3.2::el7 | All versions | 0:3.2.1.34-2.git.20.6367d5d.el7 |
| `atomic-openshift-clients` | Red Hat:openshift:3.2::el7 | All versions | 0:3.2.1.34-2.git.20.6367d5d.el7 |
| `atomic-openshift-clients-redistributable` | Red Hat:openshift:3.2::el7 | All versions | 0:3.2.1.34-2.git.20.6367d5d.el7 |
| `atomic-openshift-docker-excluder` | Red Hat:openshift:3.2::el7 | All versions | 0:3.2.1.34-2.git.20.6367d5d.el7 |
| `atomic-openshift-dockerregistry` | Red Hat:openshift:3.2::el7 | All versions | 0:3.2.1.34-2.git.20.6367d5d.el7 |

Products: Kubernetes Kubernetes, Netapp Trident, Redhat Openshift Container Platform.

## How do I fix CVE-2018-1002105?

Upgrade github.com/kubernetes/kubernetes to a fixed version for your release line: 1.10.11, 1.11.5 or 1.12.3.

## Is CVE-2018-1002105 being exploited?

There is no known exploitation of CVE-2018-1002105 in the wild and no public exploit code.

Public exploit code:

- PoC for CVE-2018-1002105. (github_poc): https://github.com/evict/poc_CVE-2018-1002105
- Test utility for cve-2018-1002105 (github_poc): https://github.com/gravitational/cve-2018-1002105
- 个人整理的Centos7.x + Kubernetes-1.12.3 + Dashboard-1.8.3 无 CVE-2018-1002105 漏洞的master节点全自动快速一键安装部署文件，适用于测试环境，生产环境的快速安装部署 (github_poc): https://github.com/imlzw/Kubernetes-1.12.3-all-auto-install
- PoC command injection example for cve-2018-1002105 based off https://github.com/gravitational/cve-2018-1002105 (github_poc): https://github.com/bgeesaman/cve-2018-1002105
- https://github.com/sh-ubh/CVE-2018-1002105 (github_poc): https://github.com/sh-ubh/CVE-2018-1002105
- Kubernetes - (Unauthenticated) Arbitrary Requests (exploitdb)

## Other vulnerabilities in Kubernetes Kubernetes

- [CVE-2017-1000056](https://insights.sbomify.com/CVE-2017-1000056/): Kubernetes Privilege Escalation (critical 9.8)
- [CVE-2016-1906](https://insights.sbomify.com/CVE-2016-1906/): Authorization bypass in Openshift (critical 9.8)
- [CVE-2023-3676](https://insights.sbomify.com/CVE-2023-3676/): Kubernetes - Windows nodes - Insufficient input sanitization leads to privilege escalation (high 8.8)
- [CVE-2023-3955](https://insights.sbomify.com/CVE-2023-3955/): Kubernetes - Windows nodes - Insufficient input sanitization leads to privilege escalation (high 8.8)
- [CVE-2021-25741](https://insights.sbomify.com/CVE-2021-25741/): Symlink Exchange Can Allow Host Filesystem Access (high 8.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2018-1002105 and fix it if it is affected.

What it is: CVE-2018-1002105 is a critical server-side request forgery vulnerability in Kubernetes Kubernetes, published on 5 Dec 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2018-1002105 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/kubernetes/kubernetes (Go): affected all versions; fixed in 1.10.11, 1.11.5, 1.12.3
- github.com/kubernetes/kubernetes (Go): affected all versions; fixed in 1.10.11
- github.com/kubernetes/kubernetes (Go): affected all versions; fixed in 1.10.11
- github.com/kubernetes/kubernetes (Go): affected from 1.11.0; fixed in 1.11.5
- github.com/kubernetes/kubernetes (Go): affected from 1.11.0; fixed in 1.11.5
- github.com/kubernetes/kubernetes (Go): affected from 1.12.0; fixed in 1.12.3
- github.com/kubernetes/kubernetes (Go): affected from 1.12.0; fixed in 1.12.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2018-1002105/ (Markdown: https://insights.sbomify.com/CVE-2018-1002105/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2018-1002105
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2018-1002105
- OSV: https://osv.dev/vulnerability/CVE-2018-1002105

---
From sbomify Insights: https://insights.sbomify.com/CVE-2018-1002105/
Summaries are generated and may contain mistakes; the official description above is the record.
