CVE-2026-142202: PHPOffice PHPWord through 1.4.0 Path Traversal via Zip Entry Names in Image Handling
PHPOffice PHPWord through 1.4.0 contains a path traversal vulnerability in Element\Image::getImageString() and Writer\AbstractWriter::addFileToPackage() that allows attackers to read and delete arbitrary files via crafted zip entry names. Attackers can submit a docx whose image relationship targets and zip entries contain ../ sequences, exposing server files in converted output and unlinking files writable by the web server.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using composer/phpoffice/phpword through version 1.4.0 are exposed when they process attacker-supplied DOCX files. The attacker must be able to submit a crafted document for processing.
What does an attacker need to include in a malicious document?
The DOCX must contain image relationship targets and ZIP entry names with ../ sequences. These traversal sequences are used during image handling and package creation.
What is the practical impact on the server?
A successful attack can expose arbitrary server files in converted output and delete files that are writable by the web server. The deletion capability is limited by the web server process's write permissions.
How can suspicious input documents be identified?
Inspect DOCX ZIP contents and image relationship targets for ../ path-traversal sequences. Such sequences in image-related ZIP entry names or relationship targets are indicators of an attempted exploit.