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-2020-12062

CVE-2020-12062: OpenBSD OpenSSH RCE Vulnerability

CVE-2020-12062 is a remote code execution flaw in OpenBSD OpenSSH 8.2 that allows malicious users to overwrite arbitrary files during scp downloads. This article covers technical details, affected versions, and mitigation.

Published: March 11, 2026

CVE-2020-12062 Overview

CVE-2020-12062 is an improper input validation vulnerability affecting the SCP (Secure Copy Protocol) client in OpenSSH 8.2. The vulnerability allows a malicious unprivileged user on a remote server to overwrite arbitrary files in a client's download directory by exploiting how the SCP client handles duplicate responses after a utimes system call failure.

When a user connects to a compromised or malicious SSH server using the scp -rp command to recursively download files with preserved timestamps, an attacker who controls the remote server can craft a malicious subdirectory structure that triggers duplicate responses. This race condition enables the attacker to overwrite files in the victim's download directory.

Critical Impact

A malicious actor on a remote SSH server can overwrite arbitrary files in a client's download directory, potentially leading to code execution, data corruption, or configuration tampering on the victim's system.

Affected Products

  • OpenBSD OpenSSH 8.2

Discovery Timeline

  • 2020-06-01 - CVE-2020-12062 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2020-12062

Vulnerability Analysis

This vulnerability exploits a flaw in how the OpenSSH SCP client handles response acknowledgments to the server. When a utimes system call fails during a recursive copy operation with the -rp flags (recursive with preserved timestamps), the SCP client incorrectly sends duplicate responses to the server. This inconsistency creates an opportunity for exploitation.

The vulnerability is classified under CWE-20 (Improper Input Validation), as the client fails to properly validate and handle the state of file transfer operations during error conditions. An attacker with access to the remote server can create a specially crafted subdirectory structure that, when downloaded, triggers this duplicate response behavior and allows files to be written to unintended locations within the client's download directory.

It is worth noting that the OpenSSH vendor has indicated that this attack can achieve no more than what a hostile peer could already accomplish within the SCP protocol, and that utimes does not typically fail under normal circumstances. Nevertheless, the vulnerability represents a real security risk in scenarios involving potentially malicious servers.

Root Cause

The root cause lies in the SCP client's error handling logic when processing utimes system calls. Instead of properly managing the error state and sending a single appropriate response, the client sends duplicate responses to the server. This protocol violation creates an inconsistent state that can be exploited to manipulate file write operations during the recursive download process.

Attack Vector

The attack requires the following conditions:

  1. The victim must connect to a server controlled by or accessible to the attacker
  2. The victim must use the scp -rp command (recursive copy with preserved file timestamps)
  3. The attacker must have the ability to create directories on the remote server
  4. A utimes system call must fail during the transfer (which can be triggered through crafted directory structures)

The attacker creates a malicious subdirectory structure anywhere on the remote server. When the victim downloads a file hierarchy containing this crafted subdirectory, the duplicate response bug is triggered, allowing the attacker to redirect file writes to arbitrary locations within the victim's download directory.

Detection Methods for CVE-2020-12062

Indicators of Compromise

  • Unexpected files appearing in SCP download directories after transfers from external servers
  • File modification timestamps that don't match expected values after scp -rp operations
  • Unusual directory structures created during SCP file transfers
  • Log entries showing utimes failures during SCP operations

Detection Strategies

  • Monitor SCP client operations for unusual file creation patterns in download directories
  • Implement file integrity monitoring on directories commonly used as SCP destinations
  • Review SSH client logs for unexpected error conditions during file transfers
  • Deploy endpoint detection rules to identify files created outside expected directories during SCP operations

Monitoring Recommendations

  • Enable verbose logging for SSH/SCP client operations with -v flags during suspicious transfers
  • Implement baseline monitoring for critical directories that receive files via SCP
  • Configure security tools to alert on unexpected file modifications following SCP transfers
  • Audit systems for OpenSSH version 8.2 and flag for priority patching

How to Mitigate CVE-2020-12062

Immediate Actions Required

  • Upgrade OpenSSH to version 8.3 or later, which contains the fix for this vulnerability
  • Avoid using the -rp flags with scp when connecting to untrusted or potentially malicious servers
  • Consider using rsync over SSH or sftp as alternatives to SCP for recursive file transfers
  • Restrict SCP usage to trusted internal servers until patching is complete

Patch Information

OpenSSH addressed this vulnerability in version 8.3. The fix modifies how the SCP client handles responses after utimes failures to prevent duplicate responses from being sent to the server.

The following resources provide patch details:

  • OpenSSH Release Announcement 8.3
  • GitHub OpenSSH Commit Update

Workarounds

  • Use sftp instead of scp for secure file transfers, as it uses a different protocol not affected by this vulnerability
  • Use rsync over SSH (rsync -avz -e ssh) as an alternative for recursive directory transfers
  • Implement strict access controls on remote servers to limit the ability of unprivileged users to create arbitrary directory structures
  • Validate the integrity of downloaded files using checksums after completing SCP transfers from less-trusted sources
bash
# Check OpenSSH version and upgrade if necessary
ssh -V

# Alternative: Use sftp for secure transfers instead of scp
sftp -r user@remoteserver:/path/to/directory /local/destination/

# Alternative: Use rsync over SSH
rsync -avz -e ssh user@remoteserver:/path/to/directory /local/destination/

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechOpenssh

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.83%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-20
  • Technical References
  • GitHub OpenSSH Commit Update

  • Openwall OSS-Security Discussion
  • Vendor Resources
  • GitHub OpenSSH Commit Update

  • OpenSSH Release Announcement 8.3
  • Related CVEs
  • CVE-2026-35386: OpenSSH RCE Vulnerability via Metacharacters

  • CVE-2025-61984: OpenSSH RCE Vulnerability

  • CVE-2023-51385: OpenBSD OpenSSH RCE Vulnerability

  • CVE-2020-15778: OpenSSH SCP Command Injection Vulnerability
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