Bug 2585481
| Summary: | CVE-2026-137727 tnef: Tnef <= 1.4.18 Heap OOB Read in MAPI MIME Tag and Content ID Printing [fedora-all] | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | gkamathe |
| Component: | tnef | Assignee: | Artur Frenszek-Iwicki <fedora> |
| Status: | ON_QA --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | rawhide | CC: | dtimms, fedora |
| Target Milestone: | --- | Keywords: | Security, SecurityTracking |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | {"flaws": ["65f1bd69-149f-40b8-8536-c959bb326b52"]} | ||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 2585324 | ||
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 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 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. 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. |
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. file_add_mapi_attrs() copies MAPI attachment MIME tags and content IDs into buffers sized from the raw property length, without ensuring that the copied string is NUL-terminated. Printing either field with --list-with-mime-types or -v can read beyond the heap allocation. Root-Cause Analysis src/mapi_attr.c:308-322 leaves v->len as the raw MAPI length. For ordinary strings it allocates v->len + 1 and appends a NUL; for Unicode strings it converts the raw bytes to UTF-8 without updating v->len: v->len = GETINT32(buf+idx); if (a->type == szMAPI_UNICODE_STRING) v->data.buf = (unsigned char*)unicode_to_utf8(v->len, buf+idx); else { v->data.buf = CHECKED_XMALLOC_ADDNULL(unsigned char, v->len); memmove(v->data.buf, buf+idx, v->len); v->data.buf[v->len] = '\0'; } src/file.c:196-207 copies exactly a->values[0].len bytes into an equally sized buffer for both MAPI_ATTACH_MIME_TAG and MAPI_ATTACH_CONTENT_ID, discarding any terminator at or beyond that length: file->mime_type = CHECKED_XMALLOC(char, a->values[0].len); memmove(file->mime_type, a->values[0].data.buf, a->values[0].len); The content-ID branch performs the same allocation and copy. src/file.c:159-163 then prints each buffer with %s. A valid UTF-16 value consisting of two U+0800 units and a NUL has raw length 6 but decodes to six non-NUL UTF-8 bytes followed by a NUL at index 6; the six-byte destination lacks that terminator. Conversely, a valid ASCII UTF-16 value such as AB\\0 decodes to AB\\0 in a larger raw-malloc buffer, so copying the raw six-byte length includes three uninitialized bytes after the NUL. Steps to Reproduce Build tnef with AddressSanitizer: autoreconf -fi CC=clang CFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer" LDFLAGS="-fsanitize=address" ./configure make Create a proof-of-concept TNEF file using the script poc_mapi_metadata_overread.py python3 poc_mapi_metadata_overread.py mime unicode-wide poc-mime-valid.tnef Run tnef by feeding the resulting TNEF file: tnef --list-with-mime-types poc-mime-valid.tnef Observe an AddressSanitizer reporting a heap-buffer-overflow, READ of size 5.