Bug 2585480 - CVE-2026-137726 tnef: Tnef <= 1.4.18 Path Traversal with --use-paths Allows File Writes Outside the Extraction Directory [fedora-all]
Summary: CVE-2026-137726 tnef: Tnef <= 1.4.18 Path Traversal with --use-paths Allows F...
Keywords:
Status: ON_QA
Alias: None
Product: Fedora
Classification: Fedora
Component: tnef
Version: rawhide
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Artur Frenszek-Iwicki
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: {"flaws": ["aa440f58-c993-4ff8-99fc-9...
Depends On:
Blocks: CVE-2026-137726
TreeView+ depends on / blocked
 
Reported: 2026-11-27 14:44 UTC by gkamathe
Modified: 2026-11-28 04:21 UTC (History)
2 users (show)

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


Attachments (Terms of Use)

Description gkamathe 2026-11-27 14:44:01 UTC
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.

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

Comment 1 Fedora Update System 2026-11-27 20:23:20 UTC
FEDORA-2026-479c3c18e2 (tnef-1.5.0-1.fc45) has been submitted as an update to Fedora 45.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-479c3c18e2

Comment 2 Fedora Update System 2026-11-27 20:33:49 UTC
FEDORA-2026-ebd2692f11 (tnef-1.5.0-1.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-ebd2692f11

Comment 3 Fedora Update System 2026-11-28 04:01:22 UTC
FEDORA-2026-479c3c18e2 has been pushed to the Fedora 45 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-479c3c18e2`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-479c3c18e2

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2026-11-28 04:21:41 UTC
FEDORA-2026-ebd2692f11 has been pushed to the Fedora 44 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-ebd2692f11`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-ebd2692f11

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.


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