Summary
Group-Office contains an authenticated remote code execution flaw in its TNEF (winmail.dat) attachment processing pipeline, where attacker-controlled filenames are passed to zip with a shell wildcard.
When a logged-in user processes a malicious winmail.dat attachment, crafted filenames can be interpreted as zip options, leading to arbitrary command execution under the server's Group-Office account.
Affected context
This vulnerability occurs in Group-Office deployments that:
- Process TNEF (
winmail.dat) attachments on the server side - Extract files from
winmail.datinto a working directory - Invoke the
ziputility with a shell wildcard (e.g.,*) over those extracted files - Rely on system shell command construction that does not safely separate options from filenames
It becomes relevant when authenticated users or integrated workflows can cause the application to ingest attacker-controlled winmail.dat content.
Exploit preconditions
- Attack surface: Server-side email / attachment processing in Group-Office.
- Required access: Authenticated ability to upload or otherwise cause processing of a crafted
winmail.dat(TNEF) attachment. - Trigger point: The TNEF processing flow extracts files from
winmail.datand later callszipwith a shell wildcard that expands over these attacker-controlled filenames. - Why exploitation is possible: Filenames extracted from the TNEF payload are not sanitized, normalized, or safely passed as arguments; when combined with a wildcard-based
zipinvocation, specially crafted filenames can be interpreted as command-line options (and potentially shell metacharacters), allowing arbitrary command execution.
Why this happens
The core issue is unsafe command construction that allows user-controlled data to influence command-line parsing.
In the TNEF attachment flow, the application:
- Extracts filenames directly from
winmail.dat(attacker-controlled content), - Places them into a directory,
- Calls the
ziputility using a pattern likezip archive.zip *via a shell.
Because shell expansion and zip's option parsing are both sensitive to leading - and special characters, filenames crafted to look like options or to include shell metacharacters can alter the behavior of the command.
This aligns with CWE-88: Argument Injection or Modification, where untrusted input controls command-line arguments to system utilities. The behavior also overlaps with CWE-434: Unrestricted Upload of File with Dangerous Type, since arbitrary files are ingested and treated without sufficient validation, but the primary bug class is the unsafe argument handling and shell invocation.
Potential impact
- Arbitrary command execution in the context of the Group-Office server process
- Reading, modifying, or deleting application-managed data and configuration
- Pivoting to other internal systems reachable from the application server
- Planting backdoors or web shells for persistent access
- Interfering with email processing, attachment integrity, or user data confidentiality
General mitigation guidance
Effective mitigation focuses on removing attacker control from command-line arguments and hardened file handling:
- Avoid passing untrusted filenames to shell-constructed commands; use safe process invocation APIs that pass arguments as arrays without shell interpretation.
- Do not rely on shell wildcards (e.g.,
*) over directories containing user-controlled filenames; build explicit, validated file lists in application logic. - Normalize and validate extracted filenames: reject names that begin with
-, contain unexpected metacharacters, or are otherwise unsafe, and map them to benign, generated names. - Restrict what external utilities are used for attachment processing; prefer language-native libraries that avoid shelling out.
- Run Group-Office and related processing components under least-privilege accounts with minimal filesystem and network rights, limiting the blast radius if a command is compromised.
How teams detect issues like this
Organizations can look for this pattern using:
- Static analysis: Rules that flag uses of
exec,system,popen, or similar APIs where arguments contain wildcards or concatenate paths derived from attachment or user input; checks for passing*or unvalidated filenames into shell commands. - Code review: Explicit review of email and attachment processing code paths, verifying that external utilities (like
zip) are invoked with fixed options and sanitized arguments; red flags include building command strings manually and calling system shells. - Runtime monitoring: Application and OS-level logging for suspicious
zipinvocations (e.g., unusual options, unexpected working directories) and anomalous child processes spawned from the web or application server. - Policy enforcement: CI/CD pipelines that block merges when unsafe shell command patterns are detected, or when new attachment-processing code relies on external utilities instead of safer library APIs.

