# CVE-2026-6791: Potential stack-based buffer clash during tilde expansion in wordexp

- Severity: Medium 6.6 (CVSS:4.0, scored by glibc) `CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:L/SA:H/E:U`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.22%, higher than 13% of CVEs (2026-12-02)
- Published: 2026-08-10T18:41:25.122Z
- Modified: 2026-10-24T16:10:00.153Z
- Weaknesses: CWE-121
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: 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.

(As written by CVE List.)

## Affected

- glibc: from 2.0 up to 2.43

## References

- <https://sourceware.org/bugzilla/show_bug.cgi?id=34091> (issue-tracking)

## Sources

- CVE List: [CVE-2026-6791](https://www.cve.org/CVERecord?id=CVE-2026-6791), CVE Terms of Use, modified 2026-08-12
- NVD: [CVE-2026-6791](https://nvd.nist.gov/vuln/detail/CVE-2026-6791), Public domain, modified 2026-10-24

---

Page: https://cve.day/CVE-2026-6791 · Whole record: https://cve.day/CVE-2026-6791.json · Rebuilt by cve.day 2026-11-25T22:59:32.153Z
