SSH.NET: ScpClient Recursive Download Allows Arbitrary File Write via Server-Controlled SCP Filenames (CVE-2026-48798)
SSH.NET's ScpClient recursive download function allows a malicious SCP server to supply crafted filenames with directory traversal sequences, enabling arbitrary file writes outside the intended local directory. This can lead to overwriting critical files such as SSH authorized keys or configuration files, potentially resulting in persistence or remote code execution. A fix is available that validates filenames to ensure they remain within the target directory.
AI Analysis
Technical Summary
The vulnerability in SSH.NET's ScpClient.Download method arises because it writes files and directories using names returned by the remote SCP server during recursive downloads without validating that the resulting local path remains inside the requested directory. A malicious, compromised, or man-in-the-middle SCP server can exploit this by returning filenames containing '../' sequences or absolute paths, causing the client to write or overwrite files anywhere the client process has write access. This can lead to overwriting sensitive files such as ~/.ssh/authorized_keys, shell rc files, cron entries, or application binaries/configuration, enabling persistence, privilege escalation, or remote code execution on the client host. The issue is similar to CVE-2019-6111 in OpenSSH but includes directory traversal capability. The vendor has released a fix that ensures remote filenames are validated and throws an exception when invalid names are detected.
Potential Impact
An attacker controlling or intercepting the SCP server can cause the client to write arbitrary files outside the intended download directory. This can overwrite critical files leading to persistence mechanisms, privilege escalation, or remote code execution on the client system. The attack requires the victim to initiate a recursive directory download from the malicious SCP server.
Mitigation Recommendations
A fixed release of SSH.NET is available that validates all remotely supplied file and directory names to ensure the constructed local paths remain within the specified local directory. The client throws an ScpException when invalid names are detected, preventing directory traversal. Users should upgrade to the fixed version to mitigate this vulnerability.
SSH.NET: ScpClient Recursive Download Allows Arbitrary File Write via Server-Controlled SCP Filenames (CVE-2026-48798)
Description
SSH.NET's ScpClient recursive download function allows a malicious SCP server to supply crafted filenames with directory traversal sequences, enabling arbitrary file writes outside the intended local directory. This can lead to overwriting critical files such as SSH authorized keys or configuration files, potentially resulting in persistence or remote code execution. A fix is available that validates filenames to ensure they remain within the target directory.
CVSS v3.1
Score 7.1high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in SSH.NET's ScpClient.Download method arises because it writes files and directories using names returned by the remote SCP server during recursive downloads without validating that the resulting local path remains inside the requested directory. A malicious, compromised, or man-in-the-middle SCP server can exploit this by returning filenames containing '../' sequences or absolute paths, causing the client to write or overwrite files anywhere the client process has write access. This can lead to overwriting sensitive files such as ~/.ssh/authorized_keys, shell rc files, cron entries, or application binaries/configuration, enabling persistence, privilege escalation, or remote code execution on the client host. The issue is similar to CVE-2019-6111 in OpenSSH but includes directory traversal capability. The vendor has released a fix that ensures remote filenames are validated and throws an exception when invalid names are detected.
Potential Impact
An attacker controlling or intercepting the SCP server can cause the client to write arbitrary files outside the intended download directory. This can overwrite critical files leading to persistence mechanisms, privilege escalation, or remote code execution on the client system. The attack requires the victim to initiate a recursive directory download from the malicious SCP server.
Mitigation Recommendations
A fixed release of SSH.NET is available that validates all remotely supplied file and directory names to ensure the constructed local paths remain within the specified local directory. The client throws an ScpException when invalid names are detected, preventing directory traversal. Users should upgrade to the fixed version to mitigate this vulnerability.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-q939-rpr3-3284
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-48798"]
- Ecosystems
- ["NuGet"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a7c9b2cbf8831d539cdb54d
Added to database: 08/12/2026, 16:11:24 UTC
Last enriched: 08/12/2026, 16:20:53 UTC
Last updated: 08/12/2026, 16:20:53 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.