CVE Vulnerabilities

CVE-2021-3999

Off-by-one Error

Published: Aug 24, 2022 | Modified: Feb 12, 2023
CVSS 3.x
7.8
HIGH
Source:
NVD
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS 2.x
RedHat/V2
RedHat/V3
7.4 MODERATE
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Ubuntu
MEDIUM

A flaw was found in glibc. An off-by-one buffer overflow and underflow in getcwd() may lead to memory corruption when the size of the buffer is exactly 1. A local attacker who can control the input buffer and size passed to getcwd() in a setuid program could use this flaw to potentially execute arbitrary code and escalate their privileges on the system.

Weakness

A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.

Affected Software

Name Vendor Start Version End Version
Glibc Gnu * 2.31 (excluding)
Red Hat Enterprise Linux 8 RedHat glibc-0:2.28-164.el8_5.3 *
Red Hat Enterprise Linux 8 RedHat glibc-0:2.28-164.el8_5.3 *
Eglibc Ubuntu trusty *
Eglibc Ubuntu trusty/esm *
Glibc Ubuntu bionic *
Glibc Ubuntu esm-infra/xenial *
Glibc Ubuntu focal *
Glibc Ubuntu hirsute *
Glibc Ubuntu impish *

Potential Mitigations

References