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-24720

CVE-2022-24720: Image Processing RCE Vulnerability

CVE-2022-24720 is a remote code execution vulnerability in the Image Processing library that allows attackers to execute shell commands via unsanitized input. This article covers technical details, affected versions, and mitigation.

Published: February 17, 2026

CVE-2022-24720 Overview

CVE-2022-24720 is a command injection vulnerability in image_processing, a popular Ruby image processing wrapper for libvips and ImageMagick/GraphicsMagick. Prior to version 1.12.2, the #apply method is vulnerable to remote shell command execution when processing operations derived from unsanitized user input. This vulnerability is particularly dangerous because the #apply method is called internally by Active Storage variants, making Rails applications using Active Storage also susceptible to this attack.

Critical Impact

Attackers can achieve remote code execution by injecting malicious shell commands through unsanitized user input processed by the #apply method, potentially leading to complete system compromise.

Affected Products

  • image_processing (Ruby gem) versions prior to 1.12.2
  • Debian Linux 11.0
  • Rails applications using Active Storage with vulnerable image_processing versions

Discovery Timeline

  • 2022-03-01 - CVE-2022-24720 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-24720

Vulnerability Analysis

The vulnerability exists in the #apply method within lib/image_processing/chainable.rb. This method is designed to accept an array of operations and sequentially apply them to an image using Ruby's send method. The use of send is problematic because it allows calling any method on the builder object, including private methods, which can be leveraged to execute arbitrary shell commands when user input is not properly sanitized.

Active Storage in Rails relies on this vulnerable method internally for processing image variants, meaning any Rails application using Active Storage for image processing with user-controllable transformation parameters could be exploited without directly calling #apply.

Root Cause

The root cause is the use of Ruby's send method instead of public_send in the #apply method implementation. The send method can invoke both public and private methods on an object, whereas public_send is restricted to only public methods. By using send, an attacker could potentially call private methods that may have dangerous side effects, including methods that execute shell commands through the underlying ImageMagick or libvips binaries.

Attack Vector

The attack vector is network-based and requires no authentication or user interaction. An attacker can craft malicious input that, when passed through the #apply method, executes arbitrary shell commands on the server. This is particularly dangerous in web applications that allow users to specify image transformation parameters, such as resizing, cropping, or format conversion options.

ruby
# Security patch in lib/image_processing/chainable.rb - Prevent remote shell execution in `#apply`
     def apply(operations)
       operations.inject(self) do |builder, (name, argument)|
         if argument == true || argument == nil
-          builder.send(name)
+          builder.public_send(name)
         elsif argument.is_a?(Array)
-          builder.send(name, *argument)
+          builder.public_send(name, *argument)
         elsif argument.is_a?(Hash)
-          builder.send(name, **argument)
+          builder.public_send(name, **argument)
         else
-          builder.send(name, argument)
+          builder.public_send(name, argument)
         end
       end
     end

Source: GitHub Commit Reference

Detection Methods for CVE-2022-24720

Indicators of Compromise

  • Unusual process spawning from Ruby/Rails application processes, particularly shell executions
  • Unexpected outbound network connections from application servers
  • Modified or new files in unexpected locations created by the web application user
  • Anomalous ImageMagick or libvips command-line arguments in process logs

Detection Strategies

  • Monitor application logs for unusual image processing requests with unexpected operation names
  • Implement runtime application self-protection (RASP) to detect command injection attempts
  • Deploy Web Application Firewall (WAF) rules to filter suspicious payloads in image processing parameters
  • Use static application security testing (SAST) to identify use of vulnerable image_processing gem versions

Monitoring Recommendations

  • Enable detailed logging for image processing operations and review for anomalous patterns
  • Set up alerting for any shell command execution originating from Ruby application processes
  • Monitor gem dependency versions and receive alerts when using vulnerable image_processing versions
  • Track Active Storage variant generation requests for unusual transformation parameters

How to Mitigate CVE-2022-24720

Immediate Actions Required

  • Upgrade image_processing gem to version 1.12.2 or later immediately
  • Audit all user input that flows into image processing operations
  • Implement strict allowlist validation for any user-controllable image transformation parameters
  • Review Active Storage configurations and ensure variant definitions do not accept unsanitized user input

Patch Information

The vulnerability has been fixed in version 1.12.2 of the image_processing gem. The fix replaces send with public_send in the #apply method, preventing access to private methods that could be exploited for command execution. Users should update their Gemfile to require the patched version.

For Debian Linux 11.0 users, refer to the Debian Security Announcement DSA-5310 for official package updates.

Additional resources:

  • GitHub Security Advisory
  • Security Patch Commit

Workarounds

  • Implement strict allowlist validation for all image processing operations before passing to #apply
  • Restrict image transformation options to a predefined set of safe operations only
  • Avoid passing user-controlled input directly to Active Storage variant definitions
  • Consider sandboxing image processing in isolated containers with limited system access
bash
# Configuration example - Update Gemfile to require patched version
gem 'image_processing', '>= 1.12.2'

# Then run bundle update
bundle update image_processing

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechImage Processing

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.88%

  • 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
  • CWE-20

  • NVD-CWE-Other
  • Technical References
  • Debian Security Announcement DSA-5310
  • Vendor Resources
  • GitHub Commit Reference

  • GitHub Security Advisory
  • 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