pdf-image npm package allows OS command injection [PoC]
CVE-2026-26830
pdf-image (npm package) through version 2.0.0 allows OS command injection via the pdfFilePath parameter. The constructGetInfoCommand and constructConvertCommandForPage functions use util.format() to i...
Overview
A critical security vulnerability, tracked as CVE-2026-26830, has been discovered in the pdf-image npm package. This package is used by Node.js applications to convert PDF pages into images. The flaw allows an attacker to execute arbitrary operating system commands on the server hosting a vulnerable application.
Vulnerability Details
The vulnerability is an OS Command Injection flaw. In affected versions (2.0.0 and earlier), the library’s constructGetInfoCommand and constructConvertCommandForPage functions improperly handle user-supplied input. Specifically, they take the pdfFilePath parameter-which can be controlled by an external user-and insert it directly into a shell command string using util.format(). This string is then executed by child_process.exec() without proper sanitization or validation.
In simple terms, if an application uses this package to process a PDF file path provided by a user (e.g., from a file upload), an attacker can craft a malicious “file path” that contains shell commands. These commands will be run on the underlying server with the same privileges as the Node.js process.
Potential Impact
The impact of this vulnerability is severe (CVSS Score: 9.8 - CRITICAL). A successful exploit could allow an attacker to:
- Execute any command on the host operating system.
- Install malware, ransomware, or other malicious software.
- Steal, delete, or encrypt sensitive data from the server.
- Use the compromised server as a foothold to attack other internal systems.
- Cause a complete system compromise and service disruption.
This type of vulnerability is a primary cause of major security incidents. For analysis of real-world breaches stemming from similar flaws, you can review past incidents at breach reports.
Remediation and Mitigation
Immediate action is required to secure affected systems.
Primary Remediation:
The maintainers have released a patched version. You must upgrade the pdf-image package to version 2.0.1 or later. Update your application’s dependencies using your package manager:
npm update pdf-image
Mitigation Steps (If Immediate Update is Not Possible):
- Input Validation: If you must temporarily use a vulnerable version, implement strict server-side validation on any user input passed to the
pdf-imagefunctions. Allow only known-safe characters for file paths and reject any input containing shell metacharacters (e.g.,;,&,|,`,$). - Sandboxing: Run the Node.js application with the least necessary privileges. Do not run it as a root or administrative user. Consider using containerization or sandboxing techniques to limit the potential damage of command execution.
- Network Security: Restrict network access to the affected application and monitor its outbound connections for suspicious activity.
Stay informed about critical vulnerabilities like this by following the latest security news. Proactively managing dependencies and applying security patches is the most effective defense against such high-severity threats.
Never miss a critical vulnerability
Get real-time security alerts delivered to your preferred platform.
Public PoC References
Unverified third-party code
These repositories are publicly listed on GitHub and have not been audited by Yazoul Security. They may contain malware, backdoors, destructive payloads, or operational security risks (telemetry, exfiltration). Treat them as hostile binaries. Inspect source before execution. Run only in isolated, disposable lab environments (offline VM, no credentials, no production data).
Authorized use only. This information is provided for defensive research, detection engineering, and patch validation. Using exploit code against systems you do not own or do not have explicit written permission to test is illegal in most jurisdictions and violates Yazoul's terms of use.
| Repository | Stars |
|---|---|
| zebbernCVE/npm-cve-2026-26830-26833 Directory page for CVE-2026-26830 through CVE-2026-26833 advisories | ★ 1 |
Showing 1 of 1 known references. Source: nomi-sec/PoC-in-GitHub.
Related Advisories
Improper Control of Generation of Code ('Code Injection') vulnerability in Themeisle Woody ad snippets insert-php allows Code Injection.This issue affects Woody ad snippets: from n/a through <= 2.7.1....
All versions of the package jsonpath are vulnerable to Arbitrary Code Injection via unsafe evaluation of user-supplied JSON Path expressions. The library relies on the static-eval module to process JS...
ChurchCRM is an open-source church management system. Prior to 7.1.0, critical pre-authentication remote code execution vulnerability in ChurchCRM's setup wizard allows unauthenticated attackers to in...
MetInfo CMS versions 7.9, 8.0, and 8.1 contain an unauthenticated PHP code injection vulnerability that allows remote attackers to execute arbitrary code by sending crafted requests with malicious PHP...