CVE-2026-59996: OpenSSH scp Path Traversal Vulnerability (v10.4 Fix)
OpenSSH's scp command has a path traversal vulnerability that can cause files to be written to an unintended location when copying between two remote systems. If an attacker controls the source or destination in a remote-to-remote copy operation, they may be able to place a file in the parent directory of where it was supposed to go, potentially overwriting legitimate files or introducing malicious content into unexpected locations. This affects OpenSSH versions before 10.4.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 4.2 MEDIUM · CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:L
- Weaknesses (CWE)
- CWE-23
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-07-08 / 2026-07-09
NVD description (verbatim)
scp in OpenSSH before 10.4 may place a file in the parent directory of an intended directory when the copy occurs between two remote destinations.
3 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
CVE-2026-59996 is a path traversal flaw in scp (secure copy) implemented in OpenSSH prior to version 10.4. The vulnerability occurs during remote-to-remote file transfer operations when path normalization fails to properly validate the destination. An attacker who can influence the source or destination path in an scp command may traverse the directory structure and place files outside the intended target directory. The flaw is rooted in inadequate input sanitization (CWE-23: Relative Path Traversal) and requires user interaction to trigger—specifically, a user must initiate an scp command to or from a malicious remote endpoint or one under attacker control.
Business impact
The primary risk is data integrity compromise and potential system compromise through file placement attacks. An attacker could overwrite critical configuration files, inject malicious scripts into startup directories, or replace legitimate files with trojanized versions if they can intercede in an scp operation. Organizations that frequently use scp for remote data synchronization, backup transfers, or deployment automation face elevated risk. The requirement for user interaction mitigates the risk somewhat, but social engineering or compromised automation scripts could lower that barrier. For most organizations, this is a medium-priority issue requiring attention during the next maintenance cycle but not an emergency.
Affected systems
OpenSSH installations running versions before 10.4 are affected. This includes distributions of OpenBSD OpenSSH and any third-party builds incorporating the vulnerable scp implementation. Both client and server components are in scope if either is running a vulnerable version and the user initiates a remote-to-remote copy. Systems that do not use scp, or that have already upgraded to 10.4 or later, are unaffected.
Exploitability
Exploitation requires user interaction—specifically, a user must run an scp command that involves a remote destination or source controlled or influenced by an attacker. This is not a remotely exploitable worm vector. However, the attack surface is real for organizations where scp is used in automation scripts, deployment pipelines, or where users routinely copy data to or from untrusted or compromised systems. An attacker would need to either control a remote endpoint or perform a man-in-the-middle attack to inject a malicious path. The CVSS score of 4.2 (Medium) reflects the requirement for user action and network proximity, balanced against the integrity impact.
Remediation
Upgrade OpenSSH to version 10.4 or later. Verify the version on affected systems using 'ssh -V' or 'sshd -V'. Organizations should prioritize patching systems where scp is actively used in critical workflows, automated processes, or where users frequently transfer sensitive data. After patching, test remote-to-remote copy operations to ensure compatibility with your deployment environment.
Patch guidance
Consult your operating system vendor or OpenSSH distribution maintainer for patch availability. Most Linux distributions and BSD systems have already backported fixes or released updated packages. Verify the OpenSSH version in your package manager and apply updates through your standard patch management process. OpenSSH 10.4 and later versions contain the fix. If using a third-party or custom build, ensure you are pulling from a source that has incorporated the upstream fix from the OpenSSH project. Test in a non-production environment first to confirm compatibility with your scp-dependent workflows.
Detection guidance
Monitor for unexpected file creation or modification in parent directories relative to intended scp destinations, particularly around configuration, script, or startup directories. Audit scp command invocations in shell histories and authentication logs for suspicious path patterns. Monitor for unusual directory traversal patterns in ssh or sftp logs (e.g., '../' sequences). Organizations using centralized logging or endpoint detection and response (EDR) tools should create detection rules for anomalous file writes following scp commands. Network-based detection is challenging given that scp operates over SSH; focus on host-based monitoring of file system changes and process execution patterns.
Why prioritize this
While the CVSS score is medium and exploitation requires user interaction, file placement attacks can have serious downstream consequences. Prioritize patching systems where scp is embedded in automation, used by privileged users, or operates in environments with elevated trust. Systems in isolated networks or where scp is rarely used can be deprioritized but should still be patched within a standard maintenance window. The vulnerability is not yet in the CISA Known Exploited Vulnerabilities catalog, so active exploitation appears limited, but this should not be a reason to defer patching indefinitely.
Risk score, explained
The CVSS 3.1 score of 4.2 reflects a medium-severity issue with network accessibility (AV:N), high attack complexity (AC:H), no privilege requirement (PR:N), and required user interaction (UI:R). The impact is limited to integrity (I:L) and availability (I:L)—no confidentiality breach. The high attack complexity and user interaction requirement substantially reduce the score. In practice, risk depends on your organization's use of scp; teams heavily dependent on remote-to-remote copy may reasonably elevate this in their internal prioritization.
Frequently asked questions
Can this vulnerability be exploited if we don't use scp?
No. If your organization does not use scp or has disabled it, this vulnerability does not pose a direct risk. However, verify your SSH configuration and audit process deployments to confirm scp is not in use in automated workflows or legacy scripts.
Does this affect SFTP or other SSH-based file transfer methods?
This vulnerability is specific to the scp utility. SFTP, rsync over SSH, and other SSH-based file transfer tools are not affected by this particular flaw, though they may have their own vulnerabilities. The path traversal issue is unique to scp's implementation.
What should we do if we can't patch immediately?
Restrict scp usage to trusted networks and endpoints where possible. Implement network segmentation to limit which systems can initiate scp commands. Review automation scripts to replace scp with safer alternatives like SFTP or rsync where feasible. Monitor file system changes around scp operations. Apply the patch as soon as your change management process allows.
Are there any workarounds while waiting for a patch?
Workarounds are limited but include: disabling scp on systems that don't require it (set 'scp' to disabled in sshd_config if supported by your version), enforcing chroot jails to restrict directory traversal scope, and implementing strict monitoring of file writes. The most effective mitigation is patching; workarounds are temporary measures only.
This analysis is provided for informational purposes and represents a point-in-time assessment based on publicly available vulnerability data and OpenSSH upstream advisories. No exploit code or weaponized proof-of-concept is provided. Organizations should conduct their own risk assessment, validate patch compatibility in non-production environments, and consult official vendor advisories before deploying patches. SEC.co makes no warranty regarding the completeness or timeliness of this information. Always verify affected versions, patch availability, and remediation steps against official vendor documentation. Source: NVD (public-domain), retrieved 2026-08-16. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-59995MEDIUMOpenSSH SFTP Path Traversal Vulnerability – Patch Guidance
- CVE-2025-48977MEDIUMApache Ignite REST API Path Traversal – Authenticated File Read Vulnerability
- CVE-2026-10074MEDIUMDreamMaker Arbitrary File Read Vulnerability (MEDIUM)
- CVE-2026-47287MEDIUMVisual Studio Code Path Traversal – File Tampering Vulnerability
- CVE-2026-48681MEDIUMOpenStack Ironic Directory Traversal File Overwrite (MEDIUM)
- CVE-2026-58522MEDIUMMicrosoft Edge Android Path Traversal Vulnerability – MEDIUM Severity
- CVE-2026-59149MEDIUMMockoon Path Traversal Leads to Unauthorized File Disclosure
- CVE-2026-8650MEDIUMProgress MOVEit Transfer Path Traversal Vulnerability in Admin Settings