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.
Published: 2026-08-10
Score: 6.6 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The glibc wordexp function implements tilde expansion by parsing a path that starts with a tilde and a username. Inside the parse_tilde routine the username is copied onto the stack with the strndupa macro, allocating exactly the length of the supplied username without a bounds check. When an attacker supplies an excessively long username, the stack allocation grows until the thread’s stack space is exhausted, causing a stack clash and resulting in an application crash. This flaw is a stack-based buffer overflow (CWE‑121) that can be used to deny service.

Affected Systems

The vulnerability exists in the GNU C Library (glibc) on any platform where the current wordexp implementation contains the unpatched code. No specific version numbers are provided, so all releases that have not yet incorporated the fix are potentially vulnerable.

Risk and Exploitability

The CVSS score of 6.6 indicates moderate severity, and the EPSS score is not available. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires an attacker to supply a very long tilde-prefixed username that reaches the wordexp function in the target process; no remote exploitation path is documented. Because the issue leads to a stack exhaustion, any process that employs wordexp and receives untrusted input could crash, causing disruption to that process.

Generated by OpenCVE AI on August 10, 2026 at 21:14 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the latest glibc update that contains the wordexp fix
  • Configure input handling to reject or truncate tilde usernames that exceed a safe length before calling wordexp
  • If possible, replace calls to wordexp with a custom implementation that performs bounds checking or use an alternative method for tilde expansion

Generated by OpenCVE AI on August 10, 2026 at 21:14 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

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


Subscriptions

The Gnu C Library Glibc
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

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

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

Weaknesses
  • CWE-121

    Stack-based Buffer Overflow