docx
Audited by Socket on Aug 19, 2026
3 alerts found:
SecurityMalwareAnomalyThis module is a document-processing utility that performs headless LibreOffice execution by installing and running a LibreOffice Basic macro from a runtime-writable profile in /tmp. The wrapper itself shows no network access or credential theft, but it provides a strong code-execution primitive (macro write + macro execution via UNO script). Because the macro payload (ACCEPT_CHANGES_MACRO) is not present in the provided fragment, its behavior cannot be verified; if that payload were malicious or tampered, the impact could be substantial within the LibreOffice execution context. Additionally, timeout handling may misreport success, which can undermine output integrity.
This wrapper executes `soffice` with environment-variable customization and, when Unix sockets are unavailable, writes C source to `/tmp`, compiles it with `gcc`, and injects the resulting shared library into `soffice` via `LD_PRELOAD`. That LD_PRELOAD + runtime compilation pattern is highly suspicious and can enable arbitrary native code execution inside a trusted third-party application. The provided fragment is truncated (the actual `_SHIM_SOURCE` payload is missing), so the true maliciousness cannot be verified from this module excerpt alone; security should be treated as high-risk pending inspection of the shim code.
No clear evidence of intentional malware, tracking, credential theft, or network-based exfiltration in this fragment. The primary security weakness is use of zipfile.ZipFile.extractall(output_path) on an untrusted Office ZIP without validating member paths, enabling potential ZIP Slip/path traversal and arbitrary file write outside the chosen output directory. Additional risk could be introduced by the unseen DOCX helper functions, but that behavior is not assessable from this module alone.