CVE-2021-25743 ANSI escape characters in kubectl output are not being filtered

Low 3.0 Published Updated

kubectl fails to filter ANSI escape sequences, allowing attackers to manipulate terminal output and potentially hide malicious activity.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-25743?

CVE-2021-25743 is a low-severity vulnerability in Kubernetes Kubernetes, published on 7 Jan 2022. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

kubectl does not neutralize escape, meta or control sequences contained in the raw data it outputs to a terminal. This includes but is not limited to the unstructured string fields in objects such as Events.

Weakness: CWE-150

Which versions are affected by CVE-2021-25743?

3 open source packages ship an affected version, including k8s.io/kubernetes. It affects 1 product.

PackageAffectedFixed in
k8s.io/kubernetes GoAll versions1.26.0-alpha.3
k8s.io/kubernetes GoAll versions1.26.0-alpha.3
k8s.io/kubernetes GoAll versions1.26.0-alpha.3
Linux distribution packages (10)
kubernetes1.23 SUSE:Linux Enterprise Module for Containers 15 SP5All versions1.23.17-150500.3.15.1
kubernetes1.24 SUSE:Linux Enterprise Module for Containers 15 SP5All versions1.24.17-150500.3.19.1
kubernetes1.25 SUSE:Linux Enterprise Module for Containers 15 SP5All versions1.25.16-150400.9.10.1
kubernetes1.25 SUSE:Linux Enterprise Module for Containers 15 SP6All versions1.25.16-150400.9.10.1
kubernetes1.23 openSUSE:Leap 15.5All versions1.23.17-150500.3.15.1
kubernetes1.24 openSUSE:Leap 15.5All versions1.24.17-150500.3.19.1
kubernetes1.25 openSUSE:Leap 15.5All versions1.25.16-150400.9.10.1
kubernetes1.23 openSUSE:Leap 15.6All versions1.23.17-150500.3.15.1
kubernetes1.24 openSUSE:Leap 15.6All versions1.24.17-150500.3.19.1
kubernetes1.25 openSUSE:Leap 15.6All versions1.25.16-150400.9.10.1

Products include Kubernetes Kubernetes.

How do I fix CVE-2021-25743?

Upgrade k8s.io/kubernetes to 1.26.0-alpha.3 or later.

Is CVE-2021-25743 being exploited?

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

All Kubernetes Kubernetes vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-25743, GHSA-f9jg-8p32-2f55, GO-2022-0983, OESA-2022-2132, OESA-2023-1020, SUSE-SU-2024:2858-1 and 2 more.

Is CVE-2021-25743 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free