Summary
A critical OS command injection vulnerability in zerox 1.1.20 affects the file download and document-processing workflow. When a document URL supplies an unsanitized temporary-file extension, crafted input may be incorporated into shell commands executed by Poppler utilities, allowing arbitrary operating-system command execution before processing begins.
Affected context
The vulnerability occurs in zerox deployments that download documents from URLs and derive temporary-file extensions from those URLs before invoking Poppler utilities. It becomes risky when URL-controlled extension data is inserted into shell commands without strict validation or when the processing service handles attacker-influenced document locations.
Exploit preconditions
- Attack surface: The document URL download and conversion workflow
- Required access: Ability to submit or influence a document URL processed by zerox
- Trigger point: Temporary-file creation or document processing before Poppler execution
- Why exploitation is possible: URL-derived extension data is interpolated into shell commands without sufficient sanitization, allowing shell metacharacters or command-substitution syntax to alter command behavior
Why this happens
The underlying bug is command construction from attacker-influenced data. A temporary-file extension derived from a document URL is treated as trusted text and interpolated into a shell command used to invoke Poppler utilities. This insecure pattern maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because input can affect shell interpretation rather than remaining a data-only value.
Potential impact
- An attacker could execute arbitrary operating-system commands under the service account.
- The document-processing host or container could be compromised.
- Sensitive files, credentials, or environment variables could be exposed.
- The vulnerability could enable unauthorized modification or deletion of local data.
- A compromised process could be used for lateral movement, depending on available privileges and network access.
General mitigation guidance
Mitigation typically focuses on removing shell interpretation from document-processing workflows and reducing trust in URL-derived metadata.
Common defensive patterns include:
- Invoke Poppler utilities through an argument array or process API that does not use a shell.
- Treat file extensions as data selected from a strict allowlist of expected values.
- Derive temporary filenames independently of attacker-controlled URLs.
- Validate URL components before processing and reject unexpected control characters or delimiters.
- Run document conversion with least-privilege service accounts and restricted filesystem and network permissions.
- Use isolated, short-lived processing environments with minimal access to secrets.
- Apply secure-by-default subprocess policies and avoid command-string concatenation.
How teams detect issues like this
Organizations can identify this class of issue through:
- Static analysis rules for shell invocation, command-string concatenation, and subprocess APIs that enable shell interpretation.
- Code review checks for URL, filename, suffix, or extension values flowing into process execution.
- Tests using benign metacharacter-like boundary cases to verify that input remains a single argument rather than command syntax.
- Runtime monitoring for unexpected child processes, command interpreters, or Poppler executions with anomalous arguments.
- Policy enforcement requiring allowlisted file types and non-shell process APIs for document conversion.
- Automated security review tools that trace untrusted input into operating-system command execution.

