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.
{
"license": "CC-BY-4.0",
"sources": [
{
"affected": {
"gnu:glibc": [
"< 2.31"
]
},
"database_specific": {
"status": "Modified"
},
"html_url": "https://nvd.nist.gov/vuln/detail/CVE-2021-3999",
"id": "CVE-2021-3999",
"imported": "2026-12-02T20:36:47.144Z",
"modified": "2026-10-14T10:17:50.007Z",
"published": "2022-08-24T16:15:09.077Z",
"url": "https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2021-3999"
}
]
}