glibc getcwd() off-by-one leads to local privilege escalation
CVE-2021-3999 Published on August 24, 2022

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.

NVD

Vulnerability Analysis

CVE-2021-3999 can be exploited with local system access, and requires small amount of user privileges. This vulnerability is considered to have a low attack complexity. The potential impact of an exploit of this vulnerability is considered to be very high.

Attack Vector:
LOCAL
Attack Complexity:
LOW
Privileges Required:
LOW
User Interaction:
NONE
Scope:
UNCHANGED
Confidentiality Impact:
HIGH
Integrity Impact:
HIGH
Availability Impact:
HIGH

Weakness Type

What is an off-by-five Vulnerability?

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

CVE-2021-3999 has been classified to as an off-by-five vulnerability or weakness.


Products Associated with CVE-2021-3999

You can be notified by email with stack.watch whenever vulnerabilities like CVE-2021-3999 are published in these products:

 
 
 
 
 
 

Exploit Probability

EPSS
0.78%
Percentile
73.47%

EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.