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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-2026-22035

CVE-2026-22035: Greenshot OS Command Injection Vulnerability

CVE-2026-22035 is an OS command injection flaw in Greenshot that allows attackers to execute arbitrary commands through malicious filenames. This article covers the technical details, affected versions, and mitigation.

Updated: May 14, 2026

CVE-2026-22035 Overview

CVE-2026-22035 is an OS Command Injection vulnerability [CWE-78] affecting Greenshot, an open source Windows screenshot utility. Versions 1.3.310 and below contain a flaw in the FormatArguments method located at ExternalCommandDestination.cs:269. The method uses string.Format() to insert user-controlled filenames directly into shell commands without sanitization. Attackers can execute arbitrary commands by crafting malicious filenames containing shell metacharacters. The issue is fixed in version 1.3.311.

Critical Impact

Local attackers with low privileges can achieve arbitrary command execution on the host by supplying filenames with shell metacharacters, resulting in high impact to confidentiality, integrity, and availability.

Affected Products

  • Greenshot versions 1.3.310 and earlier
  • Greenshot ExternalCommand plugin (Greenshot.Plugin.ExternalCommand)
  • Windows installations of Greenshot using external command destinations

Discovery Timeline

  • 2026-01-08 - CVE-2026-22035 published to NVD
  • 2026-01-27 - Last updated in NVD database

Technical Details for CVE-2026-22035

Vulnerability Analysis

The vulnerability resides in Greenshot's ExternalCommand plugin, which allows users to pipe captured screenshots to external programs. The FormatArguments(string arguments, string fullpath) method constructs the command-line arguments for the external process. Before the patch, the method invoked string.Format(arguments, fullpath) directly, embedding the file path into a string that is later passed to the shell. Because the file path is user-controlled, an attacker who can influence the filename, for example by tricking a user into saving a screenshot with a crafted name, can inject shell metacharacters such as &, |, ;, $, or backticks. These characters terminate the intended command and append attacker-controlled commands that execute under the user's context.

Root Cause

The root cause is missing input validation on filenames before they are interpolated into a shell command string. The original implementation trusted the fullpath argument and performed no escaping or rejection of dangerous characters, violating safe command construction practices.

Attack Vector

Exploitation requires local access and user interaction. An attacker crafts a filename containing shell metacharacters and induces the victim to process it through Greenshot's external command destination. When the external command is invoked, the injected payload executes alongside the legitimate command.

text
// Patch diff: src/Greenshot.Plugin.ExternalCommand/ExternalCommandDestination.cs
public static string FormatArguments(string arguments, string fullpath)
{
-    return string.Format(arguments, fullpath);
+    // Validate filename doesn't contain shell metacharacters
+    char[] dangerousChars = { '&', '|', ';', '$', '`', '(', ')', '<', '>', '\n', '\r', '"', '\'', '\\' };
+
+    if (fullpath.IndexOfAny(dangerousChars) >= 0)
+    {
+        throw new ArgumentException(
+            "Filename contains potentially dangerous characters. " +
+            "For security reasons, filenames with shell metacharacters are not allowed."
+        );
+    }
+
+    // Validate arguments template doesn't use shell interpreters
+    if (arguments.Contains("cmd.exe") || arguments.Contains("powershell"))
+    {
+        LOG.Warn("ExternalCommand configured with shell interpreter - potential security risk");
+    }
+
+    // Additional: Ensure proper quoting
+    string safePath = fullpath.Replace("\"", "\\\"");
+
+    return string.Format(arguments, safePath);
}
// Source: https://github.com/greenshot/greenshot/commit/5dedd5c9f0a9896fa0af1d4980d875a48bf432cb

Detection Methods for CVE-2026-22035

Indicators of Compromise

  • Screenshot files saved with names containing shell metacharacters such as &, |, ;, $, or backticks.
  • Child processes spawned by Greenshot.exe that invoke cmd.exe, powershell.exe, or other shell interpreters with unexpected arguments.
  • Outbound network connections initiated by processes parented to Greenshot.exe shortly after a screenshot export action.

Detection Strategies

  • Monitor process creation events where the parent process is Greenshot.exe and the child is a scripting host or LOLBin.
  • Hunt for command-line arguments referencing screenshot file paths that contain shell metacharacters.
  • Inventory installed Greenshot versions across endpoints and flag any host running 1.3.310 or earlier.

Monitoring Recommendations

  • Enable command-line auditing (Windows Event ID 4688) to capture full process arguments for Greenshot child processes.
  • Forward endpoint telemetry to a centralized analytics platform for correlation of suspicious Greenshot descendants.
  • Alert on Greenshot configurations that reference cmd.exe or powershell.exe in external command templates.

How to Mitigate CVE-2026-22035

Immediate Actions Required

  • Upgrade Greenshot to version 1.3.311 or later on all affected Windows endpoints.
  • Audit existing Greenshot ExternalCommand plugin configurations for entries invoking shell interpreters and remove or harden them.
  • Restrict write access to screenshot output directories to trusted users only.

Patch Information

The fix is delivered in Greenshot 1.3.311. The patched FormatArguments method rejects filenames containing shell metacharacters, warns when arguments templates reference shell interpreters, and applies additional quoting. Review the GitHub Security Advisory GHSA-7hvw-q8q5-gpmj, the remediation commit, and the Greenshot v1.3.311 release notes for details.

Workarounds

  • Disable or remove the ExternalCommand plugin until the upgrade to 1.3.311 can be completed.
  • Configure Greenshot to save screenshots with sanitized, application-controlled filenames rather than user-supplied names.
  • Apply application allowlisting to prevent Greenshot from launching unexpected child processes such as cmd.exe or powershell.exe.
bash
# Verify installed Greenshot version on Windows (PowerShell)
Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" |
    Where-Object { $_.DisplayName -like "Greenshot*" } |
    Select-Object DisplayName, DisplayVersion, Publisher

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGreenshot

  • SeverityHIGH

  • CVSS Score7.3

  • EPSS Probability0.05%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-78
  • Technical References
  • GitHub Release v1.3.311
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Security Advisory GHSA-7hvw-q8q5-gpmj
  • Related CVEs
  • CVE-2026-25792: Greenshot Binary Hijacking Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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