Summary
A high-severity argument injection vulnerability in node-poppler affects PDF helper APIs that process the file_path argument. If an attacker can influence this value, crafted input may be interpreted as additional command-line arguments, potentially altering Poppler operations or enabling unintended command execution.
Affected context
The vulnerability occurs in node-poppler PDF wrapper functions such as pdfInfo, pdfToText, pdfToCairo, pdfToPpm, pdfImages, pdfToHtml, pdfToPs, pdfFonts, pdfDetach, pdfAttach, pdfSeparate, and pdfUnite. It becomes risky when externally influenced file_path values are passed to underlying Poppler commands without sufficient argument boundary enforcement or input trust controls.
Exploit preconditions
- Attack surface: Applications or services exposing node-poppler PDF processing functionality
- Required access: Ability to supply or influence the
file_pathargument, potentially through a remotely reachable application - Trigger point: Invocation of an affected PDF helper function
- Why exploitation is possible: The supplied value may be interpreted as command-line syntax rather than only as a file path
Why this happens
The underlying bug is insufficient separation between untrusted data and command-line arguments. A wrapper that constructs or forwards a process invocation without reliably preserving argument boundaries can allow a caller-controlled file path to introduce additional options or control values. This behavior maps primarily to CWE-88, Argument Injection, and is also related to CWE-74, Injection.
Potential impact
- An attacker may alter the behavior of PDF conversion or inspection operations.
- The application could process unintended files or write output to unintended locations.
- Sensitive data may be exposed through manipulated command options.
- Under permissive process privileges, crafted input could contribute to arbitrary command execution.
- Downstream services or generated documents could be affected.
General mitigation guidance
Mitigation generally focuses on preserving strict argument boundaries and
reducing trust in caller-controlled paths.
Common defensive patterns include:
- Passing process arguments through APIs that represent each argument separately rather than assembling shell command strings.
- Rejecting option-like values and applying strict allowlists for permitted paths and file types.
- Resolving paths within controlled directories and preventing traversal or unexpected file access.
- Using safe-by-default wrapper interfaces that do not permit arbitrary Poppler options.
- Running PDF processing with minimal filesystem, network, and operating-system privileges.
- Separating untrusted document processing from sensitive application workloads.
How teams detect issues like this
Organizations can look for this weakness through:
- Static analysis rules identifying shell command construction or unsafe process-spawn patterns.
- Code review checks for caller-controlled values passed into command wrappers.
- Tests using benign option-like and delimiter-containing inputs to verify argument boundaries.
- Runtime monitoring for unexpected Poppler flags, child processes, file access, or output locations.
- Policy enforcement requiring structured process APIs and approved input-validation helpers.
Automated code review and software composition analysis tools may help identify
affected wrapper patterns and dependency exposure.

