CVE-2026-6791

Potential stack-based buffer clash during tilde expansion in wordexp

Published Aug 10, 2026 CVSS 4.0 · 6.6 Medium EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-8737-1 GNU C Library vulnerabilities
Ubuntu USN Ubuntu USN USN-8737-2 GNU C Library vulnerabilities
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Weaknesses CWE-120
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Moderate

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
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'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
glibc
Published
Updated
Aug 12, 2026, 6:01 PM
Reserved
Apr 21, 2026, 1:48 PM
Status
Awaiting Analysis
Published
Aug 10, 2026, 7:17 PM
Modified
Oct 24, 2026, 4:10 PM
Severity
Moderate
Public date
Aug 10, 2026, 6:41 PM