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

Tue, 11 Aug 2026 03:15:00 +0000

Type Values Removed Values Added
First Time appeared The Gnu C Library
The Gnu C Library glibc
Vendors & Products The Gnu C Library
The Gnu C Library glibc

Mon, 10 Aug 2026 19:00:00 +0000

Type Values Removed Values Added
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.
Title Potential stack-based buffer clash during tilde expansion in wordexp
Weaknesses CWE-121
References
Metrics cvssV4_0

{'score': 6.6, '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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: glibc

Published:

Updated: 2026-08-10T18:41:25.122Z

Reserved: 2026-04-21T13:48:45.449Z

Link: CVE-2026-6791

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-10T19:17:30.877

Modified: 2026-08-10T19:17:30.877

Link: CVE-2026-6791

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-11T03:00:04Z