Bug 2585323 (CVE-2026-137726) - CVE-2026-137726 tnef: Tnef <= 1.4.18 Path Traversal with --use-paths Allows File Writes Outside the Extraction Directory
Summary: CVE-2026-137726 tnef: Tnef <= 1.4.18 Path Traversal with --use-paths Allows F...
Keywords:
Status: NEW
Alias: CVE-2026-137726
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 2585480
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-11-27 05:48 UTC by OSIDB Bzimport
Modified: 2026-11-27 14:55 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-11-27 05:48:09 UTC
The TNEF attachment filename handling in munge_fname() permits parent-directory segments to survive when --use-paths is enabled. The resulting extraction path can escape the extraction base: the directory selected with -C, or the current working directory when -C is omitted.
Root-Cause Analysis

src/path.c:336-350 splits the attachment name at the last backslash and changes backslashes in the directory portion to forward slashes, preserving .. components:
dir = strdup(fname);
base = rindex(dir, (int)'\\');
base++;
*base = '\0';
for (p = dir; *p; p++)
{
    if (*p == '\\') *p = '/';
}

src/path.c:388-394 sanitizes only the basename, then rejoins it with the unchanged directory:
base = sanitize_filename(base);
p = concat_fname(dir, base);

src/file.c:85-85 joins this path to the caller-selected extraction directory when provided (otherwise concat_fname uses the path as-is), and src/file.c:129-129 opens it:
path = concat_fname(directory, file->path);
fp = fopen(path, "wb");
Steps to Reproduce

    Use poc_path_traversal.py to create a TNEF file which exploits the path traversal like this:

python3 poc_path_traversal.py "../../../../root/.ssh/test.txt" test.txt

    Open the resulting tnef file using tnef:

tnef --use-paths poc-traversal.tnef


Note You need to log in before you can comment on or make changes to this bug.