CVE-2026-6791: Potential stack-based buffer clash during tilde expansion in wordexp
When expanding paths that begin with a tilde (~) followed by a username, the internal parsetilde function extracts the username to determine the user's home directory. The implementation allocates memory for this username directly on the stack using the strndupa macro. Because the size of this allocation was determined by the length of the user-supplied input without any bounds checks, passing an excessively long username e.g. thousands of characters, forces the thread to exhaust its stack space. Thus if an application passes untrusted, attacker-controlled input to the wordexp function, an attacker can trigger a stack clash.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-6791?
CVE-2026-6791 has a risk level of 33, indicating a potential impact on system security.
How do I fix CVE-2026-6791?
To mitigate CVE-2026-6791, update the affected software to the latest version that has addressed the stack-based buffer clash.
What systems are affected by CVE-2026-6791?
CVE-2026-6791 affects systems that utilize the wordexp function for path expansion that includes username tilde notation.
What does CVE-2026-6791 vulnerability entail?
CVE-2026-6791 involves a potential stack-based buffer clash when expanding paths with a tilde and username, risking arbitrary code execution.
Is CVE-2026-6791 remotely exploitable?
CVE-2026-6791 can be exploited locally as it relies on user-submitted paths that could lead to a buffer overflow.