Description
PDF::WebKit versions through 1.2 for Perl allow OS command injection via a 2-arg open() of the output path in to_pdf and of stylesheet paths in _style_tag_for.

to_pdf reads the generated PDF back from its path argument, and _style_tag_for reads each entry of the stylesheets list, by assigning the path to a local @ARGV and reading it with the diamond operator, which opens each @ARGV element with Perl's 2-arg open(). A value that begins or ends with a pipe ("| cmd", "cmd |") is run as a command rather than opened as a file, and one that begins with a redirect ("> path", ">> path") opens that path for write or append. to_file forwards its path argument to to_pdf and reaches the same read.

Any caller that forwards untrusted input as the output path or as a stylesheets entry can run a command under the process UID; with the "cmd |" form the command's output is returned in place of the PDF, and with the "> path" form the named file is truncated. Stylesheets may only be added to an HTML source, so a URL or file source exposes the output path alone.
Published: 2026-08-12
Score: n/a
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

PDF::WebKit versions up to 1.2 for Perl use a two-argument open when reading the output path in to_pdf and stylesheet paths in _style_tag_for. The Perl diamond operator opens each supplied path with a 2‑arg open, which interprets strings beginning with a pipe or redirect as commands or file redirects. If untrusted data is supplied as the output filename or as a stylesheet entry, an attacker can execute arbitrary shell commands under the process UID, capture command output into the PDF, or truncate files with redirection. The flaw therefore gives attackers denial‑of‑service, data modification, and full code execution privileges on the server.

Affected Systems

The vulnerability exists in the Perl module PDF::WebKit from the MITHALDU vendor, affecting all releases up to version 1.2. No newer fixed release is available, but a patch is published that changes the open call to a 3‑argument form, preventing interpretation of the arguments as shell commands.

Risk and Exploitability

The exploit requires the attacker to supply an untrusted path or stylesheet entry; no user interaction beyond that is needed. While an EPSS score or CVSS score is not provided, the potential for full command execution in a web context makes the risk significant. The vulnerability is not listed in the CISA KEV catalog, but the lack of a formal patch releases raises the likelihood of unnoticed exploitation.

Generated by OpenCVE AI on August 13, 2026 at 01:46 UTC.

Remediation

Vendor Workaround

No fixed release is available. Apply the patch, which reads both paths with a 3-arg open so the value is never interpreted as a command or redirect. Otherwise, do not pass untrusted input as the output path to to_pdf or to_file, or as an entry in the stylesheets list. Note that the wkhtmltopdf project is no longer being developed, and users of this package should migrate to alternative solutions.


OpenCVE Recommended Actions

  • Apply the vendor‑supplied patch that changes the open call to a 3‑arg form, ensuring that neither the output path nor stylesheet entries are interpreted as commands.
  • Validate and sanitize all output path and stylesheet inputs before passing them to to_pdf or to_file or before adding them to the stylesheets list.
  • Migrate away from the PDF::WebKit module to an actively maintained alternative, as the upstream wkhtmltopdf project is no longer supported.

Generated by OpenCVE AI on August 13, 2026 at 01:46 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 13 Aug 2026 04:30:00 +0000

Type Values Removed Values Added
References

Wed, 12 Aug 2026 23:30:00 +0000

Type Values Removed Values Added
Description PDF::WebKit versions through 1.2 for Perl allow OS command injection via a 2-arg open() of the output path in to_pdf and of stylesheet paths in _style_tag_for. to_pdf reads the generated PDF back from its path argument, and _style_tag_for reads each entry of the stylesheets list, by assigning the path to a local @ARGV and reading it with the diamond operator, which opens each @ARGV element with Perl's 2-arg open(). A value that begins or ends with a pipe ("| cmd", "cmd |") is run as a command rather than opened as a file, and one that begins with a redirect ("> path", ">> path") opens that path for write or append. to_file forwards its path argument to to_pdf and reaches the same read. Any caller that forwards untrusted input as the output path or as a stylesheets entry can run a command under the process UID; with the "cmd |" form the command's output is returned in place of the PDF, and with the "> path" form the named file is truncated. Stylesheets may only be added to an HTML source, so a URL or file source exposes the output path alone.
Title PDF::WebKit versions through 1.2 for Perl allow OS command injection via a 2-arg open() of the output path in to_pdf and of stylesheet paths in _style_tag_for
Weaknesses CWE-73
CWE-78
References

Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: CPANSec

Published:

Updated: 2026-08-13T02:53:50.907Z

Reserved: 2026-07-25T08:39:34.495Z

Link: CVE-2026-17431

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-13T00:17:31.917

Modified: 2026-08-13T04:17:18.167

Link: CVE-2026-17431

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-13T02:00:13Z

Weaknesses
  • CWE-73

    External Control of File Name or Path

  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')