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-2021-3331

CVE-2021-3331: WinSCP Remote Code Execution Vulnerability

CVE-2021-3331 is a remote code execution vulnerability in WinSCP that allows attackers to execute arbitrary programs via crafted URLs. This article covers technical details, affected versions, impact, and mitigation.

Published: March 4, 2026

CVE-2021-3331 Overview

CVE-2021-3331 is a critical remote code execution vulnerability in WinSCP, a popular open-source SFTP, FTP, WebDAV, and SCP client for Microsoft Windows. The vulnerability allows remote attackers to execute arbitrary programs by exploiting the application's URL handler with a crafted URL that loads malicious session settings. This is particularly dangerous in default installations where WinSCP is registered as the handler for sftp:// URLs, making exploitation possible through a simple malicious link click.

Critical Impact

Remote attackers can achieve arbitrary code execution on systems where WinSCP is installed as the default protocol handler, requiring no authentication and minimal user interaction.

Affected Products

  • WinSCP versions prior to 5.17.10
  • Systems with WinSCP registered as the handler for sftp:// URLs
  • Default WinSCP installations on Windows operating systems

Discovery Timeline

  • 2021-01-27 - CVE-2021-3331 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-3331

Vulnerability Analysis

This vulnerability affects WinSCP's URL protocol handler mechanism, which processes specially formatted URLs (such as sftp://) to initiate file transfer sessions. When WinSCP encounters a crafted URL, it can be tricked into loading arbitrary session settings that include executable commands. The attack requires no privileges and can be executed remotely through network-based vectors such as malicious web pages, emails containing crafted links, or other applications that invoke URL handlers.

The vulnerability is particularly severe because WinSCP commonly registers itself as the default handler for secure file transfer protocols during installation. This means that simply clicking a malicious link in a browser, email client, or document viewer could trigger the exploit without any additional user interaction beyond the initial click.

Root Cause

The root cause of CVE-2021-3331 lies in WinSCP's insufficient validation of session settings passed through URL parameters. The application's raw settings functionality allows extensive configuration options to be specified in URLs, including parameters that can specify external programs to execute. Prior to version 5.17.10, WinSCP failed to adequately restrict which settings could be loaded from URLs, allowing attackers to inject malicious configuration directives that result in code execution.

Attack Vector

The attack exploits WinSCP's role as a registered URL protocol handler. An attacker crafts a malicious URL containing embedded session settings that specify an arbitrary program to execute. When a victim clicks the link or visits a page that triggers the URL handler, WinSCP processes the URL and loads the malicious session configuration, resulting in execution of the attacker-specified program with the privileges of the current user.

The following patch was applied to address the vulnerability by preventing the loading of session settings that could lead to remote code execution:

text
 		<ProjectType>CppConsoleApplication>
 		<SanitizedProjectName>Console</SanitizedProjectName>
 		<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
-		<VerInfo_Keys>CompanyName=Martin Prikryl;FileDescription=Console interface for WinSCP;FileVersion=5.0.1.0;InternalName=console;LegalCopyright=(c) 2000-2020 Martin Prikryl;LegalTrademarks=;OriginalFilename=winscp.com;ProductName=WinSCP;ProductVersion=5.17.10.0;ReleaseType=stable;WWW=https://winscp.net/</VerInfo_Keys>
+		<VerInfo_Keys>CompanyName=Martin Prikryl;FileDescription=Console interface for WinSCP;FileVersion=5.0.1.0;InternalName=console;LegalCopyright=(c) 2000-2021 Martin Prikryl;LegalTrademarks=;OriginalFilename=winscp.com;ProductName=WinSCP;ProductVersion=5.17.10.0;ReleaseType=stable;WWW=https://winscp.net/</VerInfo_Keys>
 		<VerInfo_Locale>1033</VerInfo_Locale>
 		<VerInfo_MajorVer>5</VerInfo_MajorVer>
 		<VerInfo_MinorVer>0</VerInfo_MinorVer>

Source: GitHub Commit Details

Detection Methods for CVE-2021-3331

Indicators of Compromise

  • Unexpected WinSCP process execution with unusual command-line parameters containing raw session settings
  • Child processes spawned by winscp.exe that are not typical file transfer operations
  • Registry modifications to SFTP/SCP URL handler configurations
  • Network logs showing access to URLs with embedded WinSCP session configuration parameters

Detection Strategies

  • Monitor process creation events for winscp.exe with suspicious URL parameters in command-line arguments
  • Implement endpoint detection rules for WinSCP spawning unexpected child processes
  • Audit URL handler registrations for sftp://, scp://, and ftp:// protocols on endpoints
  • Deploy application control policies to restrict WinSCP execution contexts

Monitoring Recommendations

  • Enable detailed command-line logging on Windows endpoints to capture WinSCP invocations
  • Configure SIEM alerts for WinSCP process executions originating from browser or email client parent processes
  • Monitor for attempts to access WinSCP's raw settings functionality through unusual channels
  • Review endpoint telemetry for WinSCP versions prior to 5.17.10

How to Mitigate CVE-2021-3331

Immediate Actions Required

  • Upgrade all WinSCP installations to version 5.17.10 or later immediately
  • Audit systems to identify vulnerable WinSCP versions across the environment
  • Consider temporarily unregistering WinSCP as the default URL handler until patching is complete
  • Implement network-level filtering for suspicious URLs targeting WinSCP protocol handlers

Patch Information

WinSCP version 5.17.10 contains the fix for this vulnerability. The patch restricts which session settings can be loaded from URLs, preventing the injection of malicious configuration that could lead to code execution. Organizations should update to this version or later as soon as possible. Detailed information about the fix is available in the WinSCP Version History and the WinSCP Tracker Issue #1943.

Workarounds

  • Unregister WinSCP as the default handler for sftp://, scp://, and related URL protocols
  • Implement application whitelisting to control how WinSCP can be invoked
  • Deploy browser extensions or web filtering to block suspicious URLs targeting WinSCP
  • Use Group Policy to prevent automatic URL handler invocations
bash
# Unregister WinSCP as SFTP URL handler via registry (run as Administrator)
reg delete "HKEY_CLASSES_ROOT\sftp" /f
reg delete "HKEY_CLASSES_ROOT\scp" /f
# Note: This will prevent sftp:// and scp:// links from opening in WinSCP
# Re-register after updating to version 5.17.10 or later

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechWinscp

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability2.77%

  • 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
  • Vendor Resources
  • GitHub Commit Details

  • WinSCP Version History

  • WinSCP Raw Settings Info

  • WinSCP Tracker Issue #1943
  • 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