title: Bypass of Kubernetes API Server proxy TOCTOU
description: As mitigations to a report from 2019 and CVE-2020-8555, Kubernetes attempts to prevent proxied connections from accessing link-local or localhost networks when making user-driven connections to Services, Pods, Nodes, or StorageClass service providers. As part of this mitigation Kubernetes does a DNS name resolution check and validates that response IPs are not in the link-local (169.254.0.0/16) or localhost (127.0.0.0/8) range. Kubernetes then performs a second DNS resolution without validation for the actual connection. If a non-standard DNS server returns different non-cached responses, a user may be able to bypass the proxy IP restriction and access private networks on the control plane.
problem types: CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition
affected:
{
product: Kubernetes
vendor: Kubernetes
versions:
lessThanOrEqual: v1.18.18, status: affected, version: unspecified, versionType: custom
lessThan: unspecified, status: unknown, version: next of v1.18.18, versionType: custom
lessThanOrEqual: v1.19.10, status: affected, version: unspecified, versionType: custom
lessThan: unspecified, status: unknown, version: next of v1.19.10, versionType: custom
lessThanOrEqual: v1.20.6, status: affected, version: unspecified, versionType: custom
lessThan: unspecified, status: unknown, version: next of v1.20.6, versionType: custom
lessThanOrEqual: v1.21.0, status: affected, version: unspecified, versionType: custom
lessThan: unspecified, status: unknown, version: next of v1.21.0, versionType: custom
}
metrics:
cvssV3_1: [
attackComplexity: HIGH
attackVector: NETWORK
availabilityImpact: NONE
baseScore: 2.2
baseSeverity: LOW
confidentialityImpact: LOW
integrityImpact: NONE
privilegesRequired: HIGH
scope: UNCHANGED
userInteraction: NONE
vectorString: CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N
version: 3.1
]
workarounds: If this issue affects your clusters’ control planes, you can use dnsmasq for name resolution and configure the min-cache-ttl and neg-ttl parameters to a low non-zero value to enforce cached replies for proxied connections