cve.bz

CVE-2021-4204 Improper Input Validation

7.1 highEPSS 1.2%Fix available

High (7.1). EPSS 1.2% estimated probability of exploitation activity in the next 30 days.

On this page
An out-of-bounds (OOB) memory access flaw was found in the Linux kernel's eBPF due to an Improper Input Validation. This flaw allows a local attacker with a special privilege to crash the system or leak internal information.

Severity

CVSS 3.1

7.1 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
EPSS
1.2% (unchanged from 1.2% a week ago; 1.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 70th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWEs
CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer
CWE-20 Improper Input Validation
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-4204 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-4204?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-4204?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-4204 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
linux:linux_kernelbefore 5.8.0
linux:linux_kernel5.8.0
debian:debian_linux11.0
redhat:enterprise_linux9.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14linux5.17.3-1DEBIAN-CVE-2021-4204
Ubuntu16.04:LTSlinux-hwe-edgeno fix listedUBUNTU-CVE-2021-4204
Ubuntu18.04:LTSlinux-gcp, linux-hwe, linux-oem and 10 moreno fix listedUBUNTU-CVE-2021-4204
Ubuntu20.04:LTSlinux-aws-5.11, linux-azure-5.11, linux-oracle-5.115.11.0-1025.27~20.04.1UBUNTU-CVE-2021-4204 USN-5219-1
Ubuntu20.04:LTSlinux-aws-5.135.13.0-1011.12~20.04.1UBUNTU-CVE-2021-4204
Ubuntu20.04:LTSlinux-azure-5.135.13.0-1012.14~20.04.1UBUNTU-CVE-2021-4204
Ubuntu20.04:LTSlinux-gcp-5.115.11.0-1026.29~20.04.1UBUNTU-CVE-2021-4204 USN-5219-1
Ubuntu20.04:LTSlinux-gcp-5.135.13.0-1012.15~20.04.1UBUNTU-CVE-2021-4204
Ubuntu20.04:LTSlinux-hwe-5.115.11.0-46.51~20.04.1UBUNTU-CVE-2021-4204 USN-5219-1
Ubuntu20.04:LTSlinux-hwe-5.135.13.0-25.26~20.04.1UBUNTU-CVE-2021-4204
Ubuntu20.04:LTSlinux-oem-5.105.10.0-1055.58UBUNTU-CVE-2021-4204 USN-5219-1
Ubuntu20.04:LTSlinux-oem-5.135.13.0-1026.32UBUNTU-CVE-2021-4204 USN-5218-1
Ubuntu20.04:LTSlinux-oem-5.145.14.0-1018.19UBUNTU-CVE-2021-4204 USN-5217-1
4 more for Ubuntu in the JSON and on Ubuntu's page.
Red Hatenterprise_linux:8::baseosperf, kernel, bpftool and 30 more0:4.18.0-553.el8_10RHSA-2024:3138
Red Hatenterprise_linux:8::crbperf-debuginfo, kernel-debuginfo, bpftool-debuginfo and 7 more0:4.18.0-553.el8_10RHSA-2024:3138
Red Hatenterprise_linux:8::nfvkernel-rt, kernel-rt-kvm, kernel-rt-core and 12 more0:4.18.0-553.rt7.342.el8_10RHSA-2024:2950
Red Hatenterprise_linux:8::realtimekernel-rt, kernel-rt-core, kernel-rt-debug and 10 more0:4.18.0-553.rt7.342.el8_10RHSA-2024:2950
Red Hatrhel_eus:8.6::baseosperf, kernel, bpftool and 30 more0:4.18.0-372.91.1.el8_6RHSA-2024:0724
Red Hatrhel_eus:8.6::crbperf-debuginfo, kernel-debuginfo, bpftool-debuginfo and 7 more0:4.18.0-372.91.1.el8_6RHSA-2024:0724
Red Hatrhel_eus:8.8::baseosperf, kernel, bpftool and 30 more0:4.18.0-477.81.1.el8_8RHSA-2024:10262
Red Hatrhel_eus:8.8::crbperf-debuginfo, kernel-debuginfo, bpftool-debuginfo and 7 more0:4.18.0-477.81.1.el8_8RHSA-2024:10262
Red Hatrhev_hypervisor:4.4::el8perf, kernel-devel, perf-debuginfo and 6 more0:4.18.0-372.91.1.el8_6RHSA-2024:0724
SUSELinux Enterprise High Availability Extension 15 SP4, Linux Enterprise Live Patching 15 SP4, Linux Enterprise Module for Legacy 15 SP4 and 1 morekernel-default5.14.21-150400.24.11.1SUSE-SU-2022:2520-1
SUSELinux Enterprise High Availability Extension 15 SP5, Linux Enterprise Live Patching 15 SP5, Linux Enterprise Micro 5.5 and 2 morekernel-default5.14.21-150500.55.80.2SUSE-SU-2024:3483-1
SUSELinux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_11-150400.9.5.3SUSE-SU-2022:2520-1
SUSELinux Enterprise Live Patching 15 SP5kernel-livepatch-SLE15-SP5_Update_191-150500.11.3.2SUSE-SU-2024:3483-1
SUSELinux Enterprise Micro 5.5, Linux Enterprise Module for Basesystem 15 SP5kernel-default-base5.14.21-150500.55.80.2.150500.6.35.6SUSE-SU-2024:3483-1
SUSELinux Enterprise Module for Basesystem 15 SP4kernel-64kb, kernel-source, kernel-default and 1 more5.14.21-150400.24.11.1SUSE-SU-2022:2520-1
SUSELinux Enterprise Module for Basesystem 15 SP4kernel-default-base5.14.21-150400.24.11.1.150400.24.3.6SUSE-SU-2022:2520-1
SUSELinux Enterprise Module for Basesystem 15 SP5kernel-64kb, kernel-source, kernel-default and 1 more5.14.21-150500.55.80.2SUSE-SU-2024:3483-1
SUSELinux Enterprise Module for Development Tools 15 SP4kernel-docs, kernel-syms, kernel-source and 1 more5.14.21-150400.24.11.1SUSE-SU-2022:2520-1
SUSELinux Enterprise Module for Development Tools 15 SP5kernel-docs, kernel-source5.14.21-150500.55.80.2SUSE-SU-2024:3483-1
SUSELinux Enterprise Module for Development Tools 15 SP5kernel-syms, kernel-obs-build5.14.21-150500.55.80.1SUSE-SU-2024:3483-1
SUSELinux Enterprise Module for Public Cloud 15 SP4kernel-azure, kernel-syms-azure, kernel-source-azure5.14.21-150400.14.7.1SUSE-SU-2022:2615-1
openSUSELeap 15.4dtb-aarch64, kernel-64kb, kernel-docs and 8 more5.14.21-150400.24.11.1SUSE-SU-2022:2520-1
openSUSELeap 15.4kernel-azure, kernel-syms-azure, kernel-source-azure5.14.21-150400.14.7.1SUSE-SU-2022:2615-1
openSUSELeap 15.4kernel-default-base5.14.21-150400.24.11.1.150400.24.3.6SUSE-SU-2022:2520-1
openSUSELeap 15.5dtb-aarch64, kernel-syms, kernel-obs-qa and 1 more5.14.21-150500.55.80.1SUSE-SU-2024:3483-1
openSUSELeap 15.5kernel-64kb, kernel-docs, kernel-debug and 4 more5.14.21-150500.55.80.2SUSE-SU-2024:3483-1
openSUSELeap 15.5, Leap Micro 5.5kernel-default-base5.14.21-150500.55.80.2.150500.6.35.6SUSE-SU-2024:3483-1
openSUSELeap Micro 5.5kernel-default5.14.21-150500.55.80.2SUSE-SU-2024:3483-1
AlmaLinux8kernel-rt, kernel-rt-kvm, kernel-rt-core and 9 more4.18.0-553.rt7.342.el8_10ALSA-2024:2950
AlmaLinux8perf, kernel, bpftool and 22 more4.18.0-553.el8_10ALSA-2024:3138
Rocky Linux8kernel0:4.18.0-553.123.1.el8_10.cloud.0.1RXSA-2024:3138
Rocky Linux8kernel0:4.18.0-553.el8_10RLSA-2024:3138
Rocky Linux8kernel-rt0:4.18.0-553.rt7.342.el8_10RLSA-2024:2950

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

The default Red Hat Enterprise Linux kernel prevents unprivileged users from being able to use eBPF by the kernel.unprivileged_bpf_disabled sysctl. This would require a privileged user with CAP_SYS_ADMIN or root to be able to abuse this flaw reducing its attack space.

As successful exploitation of this bug has pre-requisites that are in general considered bad practises, this bug is rated as Moderate.

Red Hat's mitigation

For the Red Hat Enterprise Linux 7 the eBPF for unprivileged users is always disabled.

For the Red Hat Enterprise Linux 8 to confirm the current state, inspect the sysctl with the command:

# cat /proc/sys/kernel/unprivileged_bpf_disabled

The setting of 1 would mean that unprivileged users can not use eBPF, mitigating the flaw.

A kernel update will be required to mitigate the flaw for the root or users with CAP_SYS_ADMIN capabilities.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8kernel-rt-0:4.18.0-553.rt7.342.el8_10Fixed 2024-05-22RHSA-2024:2950
Red Hat Enterprise Linux 8kernel-0:4.18.0-553.el8_10Fixed 2024-05-22RHSA-2024:3138
Red Hat Enterprise Linux 8.6 Extended Update Supportkernel-0:4.18.0-372.91.1.el8_6Fixed 2024-02-07RHSA-2024:0724
Red Hat Enterprise Linux 8.8 Extended Update Supportkernel-0:4.18.0-477.81.1.el8_8Fixed 2024-11-26RHSA-2024:10262
Red Hat Virtualization 4 for Red Hat Enterprise Linux 8kernel-0:4.18.0-372.91.1.el8_6Fixed 2024-02-07RHSA-2024:0724
Red Hat Enterprise Linux 6kernelNot affected
Red Hat Enterprise Linux 7kernelAffected
Red Hat Enterprise Linux 7kernel-rtAffected
Red Hat Enterprise Linux 9kernelAffected
Red Hat Enterprise Linux 9kernel-rtWill not fix

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-4204.

Attack patterns (CAPEC)

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-119 (12), CWE-20 (51).

References

Check your stackJSON