The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2022-25765

CVE-2022-25765: Pdfkit Command Injection Vulnerability

CVE-2022-25765 is a command injection vulnerability in Pdfkit that enables remote code execution through unsanitized URLs. This article covers the technical details, affected versions, security impact, and mitigation.

Published: February 17, 2026

CVE-2022-25765 Overview

CVE-2022-25765 is a command injection vulnerability affecting the PDFKit Ruby gem. The package, starting from version 0.0.0, fails to properly sanitize URLs before passing them to underlying system commands. This allows attackers to inject arbitrary shell commands through specially crafted URL parameters, potentially leading to complete system compromise.

Critical Impact

Remote attackers can execute arbitrary commands on the server by exploiting improper URL sanitization in PDFKit, potentially leading to full system compromise without requiring authentication.

Affected Products

  • PDFKit Ruby gem (all versions from 0.0.0)
  • Fedora 35 (packages containing vulnerable PDFKit)
  • Fedora 36 (packages containing vulnerable PDFKit)
  • Fedora 37 (packages containing vulnerable PDFKit)

Discovery Timeline

  • September 9, 2022 - CVE-2022-25765 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2022-25765

Vulnerability Analysis

This vulnerability stems from inadequate input validation when processing URLs in the PDFKit library. PDFKit is a Ruby gem that wraps the wkhtmltopdf binary, which converts HTML content to PDF documents. When a URL is passed to PDFKit for PDF generation, the library constructs a command-line string that is executed by the system shell.

The vulnerability exists because the URL parameter is not properly sanitized before being incorporated into the shell command. An attacker can craft a malicious URL containing shell metacharacters and command sequences that will be interpreted and executed by the underlying shell when PDFKit processes the request.

Root Cause

The root cause is insufficient input sanitization in the URL handling logic within pdfkit.rb and source.rb. When PDFKit receives a URL to convert, it passes this value directly to the wkhtmltopdf command without adequately escaping or validating the input for shell-special characters. This allows an attacker to break out of the intended URL context and inject arbitrary shell commands using techniques such as command substitution or command chaining.

Attack Vector

The attack vector is network-based, requiring no privileges or user interaction. An attacker can exploit this vulnerability by sending a specially crafted HTTP request to an application that uses PDFKit for PDF generation. The malicious payload is typically embedded within a URL parameter that contains shell metacharacters.

For example, an attacker could inject commands by including backticks, semicolons, or other command separators within the URL parameter. When the vulnerable application passes this URL to PDFKit, the injected commands are executed with the privileges of the web application process.

The vulnerability mechanism involves:

  1. A web application accepting user-supplied URL input
  2. The URL being passed to PDFKit for PDF conversion
  3. PDFKit constructing a shell command with the unsanitized URL
  4. The shell interpreting and executing any injected commands

For detailed technical analysis and exploitation details, see the Snyk Vulnerability Report and the Packet Storm Advisory.

Detection Methods for CVE-2022-25765

Indicators of Compromise

  • Unusual child processes spawned by Ruby or wkhtmltopdf processes
  • Unexpected outbound network connections from application servers
  • Log entries containing URLs with shell metacharacters such as backticks, semicolons, pipes, or $() patterns
  • Presence of suspicious files or modifications in web application directories

Detection Strategies

  • Monitor application logs for URLs containing shell metacharacters or command injection patterns
  • Implement Web Application Firewall (WAF) rules to detect and block requests with shell injection payloads in URL parameters
  • Use runtime application self-protection (RASP) solutions to detect command execution attempts
  • Deploy endpoint detection and response (EDR) solutions to identify suspicious process execution chains

Monitoring Recommendations

  • Enable detailed logging for all PDF generation operations in applications using PDFKit
  • Set up alerts for unexpected process execution originating from Ruby application contexts
  • Monitor for unusual file system activity in directories accessible to the web application
  • Implement network-level monitoring to detect potential command-and-control communications following exploitation

How to Mitigate CVE-2022-25765

Immediate Actions Required

  • Audit all applications using the PDFKit Ruby gem to identify exposure
  • Update PDFKit to a patched version that properly sanitizes URL inputs
  • Implement strict input validation on all user-supplied URLs before passing to PDFKit
  • Consider using allow-lists for URL schemes and domains where possible

Patch Information

Organizations should update to a patched version of the PDFKit gem. Fedora users should apply the security updates announced through the Fedora Package Announcements. Check the vendor repository and security advisories for the latest patched version information.

Workarounds

  • Implement server-side URL validation to reject any input containing shell metacharacters before processing with PDFKit
  • Use a sandboxed environment or container with restricted permissions for PDF generation operations
  • Disable or restrict PDF generation features that accept user-supplied URLs until patching is complete
  • Consider using alternative PDF generation libraries that do not rely on shell command execution
bash
# Example: Add input validation before PDFKit processing
# Validate URLs match expected patterns before use
# Block characters: ` ; | & $ ( ) { } [ ] < > \ " '

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechPdfkit

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability88.79%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • NVD-CWE-Other
  • Technical References
  • Packet Storm Command Injection Advisory

  • GitHub PDFKit Code Reference

  • GitHub PDFKit Source Code Reference

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Snyk Vulnerability Report
  • Latest CVEs
  • CVE-2025-70797: LimeSurvey XSS Vulnerability

  • CVE-2025-30650: Juniper Junos OS Auth Bypass Vulnerability

  • CVE-2026-35471: Goshs Path Traversal Vulnerability

  • CVE-2026-35393: Goshs Path Traversal Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English