An integer underflow has been identified in the unicodetoutf8() function in tnef 1.4.14. This might lead to invalid write operations, controlled by an attacker.
A flaw was found in tnef. A remote attacker could exploit this vulnerability by providing a specially crafted Transport Neutral Encapsulation Format (TNEF) file containing multiple message bodies. During extraction, improper memory management triggers a use-after-free and double-free condition, causing the application to crash and resulting in a Denial of Service (DoS).
A flaw was found in tnef. The TNEF uncompressed-RTF value handler in getrtfdatafrombuf() copies an attacker-controlled uncomprsize number of bytes from the input buffer without validating that the buffer actually contains that much data beyond the 16-byte value header, resulting in a heap out-of-bounds read. The issue was confirmed under AddressSanitizer and can crash the process; when body extraction (--save-body) is enabled, the over-read memory is written into the extracted RTF output file.
A flaw was found in tnef. When a TNEF stream contains more than one MAPI RTF or HTML body value, getbodyfiles() allocates a single filename buffer and a single MIME-type buffer and assigns the same pointers to every generated output file, instead of a separate copy per file. Each of these files is later freed independently, producing a use-after-free followed by a double-free on the second and subsequent files. The issue was confirmed under AddressSanitizer and crashes the process when extracting a crafted TNEF stream with multiple body values; no code-execution primitive has been demonstrated.
A flaw was found in tnef. findfreenumber() allocates a fixed-size buffer sized for a 5-digit numeric backup suffix, but formats the counter with an unbounded sprintf(). When the --number-backups option is enabled and overwrite is disabled, a crafted TNEF stream that forces roughly 100,000 colliding candidate filenames for a single extracted attachment causes the counter to require six digits, writing past the end of the allocated heap buffer. The issue requires a non-default command-line option and a large, specially crafted input to trigger.