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

- Priority: **Routine**
- Reason: Not severe (CVSS 6.6, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-08-10 · Modified: 2026-08-12
- Aliases: UBUNTU-CVE-2026-6791, DEBIAN-CVE-2026-6791, CGA-2626-cvpg-6hvp, CGA-34vj-r4vm-5h87, CGA-34xj-q3xm-6ppf, CGA-3745-37c5-7c84, CGA-3gjw-822c-cmq5, CGA-4p6x-hxwp-xcpm, CGA-549g-vx73-2w77, CGA-5jjm-wj2g-c623, CGA-63p6-h9gc-5vh7, CGA-68m8-vhh6-jwhm, CGA-6qx5-m28p-4962, CGA-77v8-926c-qjm6, CGA-7q5j-hq96-fgj4, CGA-7wm5-c6r8-x473, CGA-82f2-7p76-qpwf, CGA-8856-9pj7-fx34, CGA-93m8-j4gm-4v3m, CGA-9gf5-grj2-rhmg, CGA-9x9h-jvxh-fx6x, CGA-c26p-9998-hvcc, CGA-c4fw-x452-fw29, CGA-cmqg-c2x6-c6pp, CGA-crpj-gqvw-j4rw, CGA-cwgc-3q39-rppw, CGA-cwx8-8v66-8cpg, CGA-f578-qqcv-r5xw, CGA-fmj8-6mw7-rpqc, CGA-g2f9-fmpr-9gj5, CGA-g6cm-q94g-f2hm, CGA-g89h-47q2-f44p, CGA-gghm-8m38-3m9w, CGA-gr9j-qm6p-wjxf, CGA-h99c-mw33-3m55, CGA-hv38-ph45-6r2r, CGA-j244-28h7-j62m, CGA-j3h4-4749-436m, CGA-jm5w-jhmp-v799, CGA-mcvg-8q6r-f287, CGA-mwqh-xx4p-j9j4, CGA-p25m-h3hp-fwgf, CGA-pg7p-jc78-5qw9, CGA-pgx4-484j-gr4w, CGA-q9rx-85qf-q76x, CGA-qg4j-82q7-g7m3, CGA-qm8f-3vp2-p87g, CGA-qmjv-858x-q8p8, CGA-r3m2-2x26-pw54, CGA-r5p6-xv85-hcw3, CGA-rqq7-x986-wwmv, CGA-vfwv-mf38-r58r, CGA-w25f-6c3m-mxj5, CGA-w5pm-xxhf-2x6x, CGA-wh79-ffqx-jhhm, CGA-xfh5-p964-7vf3, CGA-xpgf-7r52-7mrv, CGA-xwpx-mj8h-c8wm
- Record: https://cvemate.com/vulnerability/CVE-2026-6791 · JSON: https://cvemate.com/vulnerability/CVE-2026-6791/json

## Description

```text
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.
```

## Signals

- CVSS: 6.6 medium (v4.0, CVE.org) 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
- EPSS: 0.22%, percentile 13.228%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 60)

- chainguard glibc (Chainguard): \< 2.43-r10
- chainguard glibc-2.43 (Chainguard): \< 2.43-r10
- chainguard glibc-2.43-abi-report (Chainguard): \< 2.43-r10
- chainguard glibc-2.43-dev (Chainguard): \< 2.43-r10
- chainguard glibc-2.43-iconv (Chainguard): \< 2.43-r10
- chainguard glibc-2.43-locale-ca (Chainguard): \< 2.43-r10
- chainguard glibc-2.43-locale-de (Chainguard): \< 2.43-r10
- chainguard glibc-2.43-locale-en (Chainguard): \< 2.43-r10
- chainguard glibc-2.43-locale-es (Chainguard): \< 2.43-r10
- chainguard glibc-2.43-locale-extra (Chainguard): \< 2.43-r10
- chainguard glibc-2.43-locale-fr (Chainguard): \< 2.43-r10
- chainguard glibc-2.43-locale-posix (Chainguard): \< 2.43-r10
- chainguard glibc-2.43-locales (Chainguard): \< 2.43-r10
- chainguard glibc-2.43-testresults (Chainguard): \< 2.43-r10
- chainguard glibc-2.43-tracing (Chainguard): \< 2.43-r10
- chainguard ld-linux-2.43 (Chainguard): \< 2.43-r10
- chainguard libc-bin-2.43 (Chainguard): \< 2.43-r10
- chainguard libcrypt1-2.43 (Chainguard): \< 2.43-r10
- chainguard localedef-2.43 (Chainguard): \< 2.43-r10
- chainguard nscd-2.43 (Chainguard): \< 2.43-r10

## References

- <https://sourceware.org/bugzilla/show_bug.cgi?id=34091>
- <https://ubuntu.com/security/CVE-2026-6791>
- <https://www.cve.org/CVERecord?id=CVE-2026-6791>
- <https://sourceware.org/git/?p=glibc.git;a=blob;f=advisories/GLIBC-SA-2026-0013>
- <https://ubuntu.com/security/notices/USN-8737-1>
- <https://ubuntu.com/security/notices/USN-8737-2>
- <https://security-tracker.debian.org/tracker/CVE-2026-6791>
- <https://sourceware.org/glibc/>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/6xxx/CVE-2026-6791.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-6791>
- <https://sourceware.org/git/?p=glibc.git>

---

Data as of 2026-12-05T09:58:06.090Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
