CVE-2026-6791: CWE-121 Stack-based buffer overflow in The GNU C Library glibc
When expanding paths that begin with a tilde (~) followed by a username, the internal parse_tilde 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.
AI Analysis
Technical Summary
The vulnerability arises from the parse_tilde function in glibc's wordexp implementation, which uses the strndupa macro to allocate stack memory for a username extracted from a tilde-prefixed path. Because the allocation size is based directly on the length of attacker-controlled input without bounds checking, an excessively long username can exhaust the thread's stack space, leading to a stack-based buffer overflow (CWE-121). This can be triggered if an application passes untrusted input to the wordexp function. The vulnerability is identified as CVE-2026-6791 and affects glibc version 2.0. The CVSS 4.0 score is 6.6 (medium severity). No known exploits are reported in the wild, and no official remediation or patch has been published yet.
Potential Impact
An attacker who can supply untrusted input to the wordexp function can cause a stack clash by overflowing the stack with an excessively long username. This may lead to application crashes or potentially enable further exploitation depending on the context. The impact is limited by the requirement for attacker-controlled input to wordexp and the high attack complexity indicated by the CVSS vector.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid passing untrusted or attacker-controlled input to the wordexp function or any functionality that expands tilde-prefixed paths with usernames.
CVE-2026-6791: CWE-121 Stack-based buffer overflow in The GNU C Library glibc
Description
When expanding paths that begin with a tilde (~) followed by a username, the internal parse_tilde 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.
CVSS v4.0
Score 6.6medium
Affected software
The GNU C Library
glibc
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability arises from the parse_tilde function in glibc's wordexp implementation, which uses the strndupa macro to allocate stack memory for a username extracted from a tilde-prefixed path. Because the allocation size is based directly on the length of attacker-controlled input without bounds checking, an excessively long username can exhaust the thread's stack space, leading to a stack-based buffer overflow (CWE-121). This can be triggered if an application passes untrusted input to the wordexp function. The vulnerability is identified as CVE-2026-6791 and affects glibc version 2.0. The CVSS 4.0 score is 6.6 (medium severity). No known exploits are reported in the wild, and no official remediation or patch has been published yet.
Potential Impact
An attacker who can supply untrusted input to the wordexp function can cause a stack clash by overflowing the stack with an excessively long username. This may lead to application crashes or potentially enable further exploitation depending on the context. The impact is limited by the requirement for attacker-controlled input to wordexp and the high attack complexity indicated by the CVSS vector.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid passing untrusted or attacker-controlled input to the wordexp function or any functionality that expands tilde-prefixed paths with usernames.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- glibc
- Date Reserved
- 2026-04-21T13:48:45.449Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a7a1efbbf8831d5395b0eb7
Added to database: 08/10/2026, 18:56:59 UTC
Last enriched: 08/10/2026, 19:17:36 UTC
Last updated: 09/23/2026, 01:47:44 UTC
Views: 79
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.