☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2026-59997

CVE-2026-59997 Vulnerability in OpenSSH
📅 PUBLISHED: 2026-07-08 00:00 UTC 🔄 UPDATED: 2026-09-23 20:36 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: CONFIRMED — 3+ independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.18%
👁️
0.18% probability
4.4× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Country: Australia License: Open Source
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
4.2
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2026-59997 is a command-line argument parsing flaw in OpenSSH's internal-sftp subsystem, present in versions prior to 10.4. When internal-sftp is invoked via sshd, it processes only the first 9 command-line arguments, silently ignoring any subsequent ones. This truncation can undermine intended security controls if an administrator configured an SFTP session with restrictive flags (e.g., -d for chroot directory, -u for umask) in positions beyond the 9th argument, allowing affected users to operate with broader access than intended. The vulnerability carries a CVSS score of 4.2 (Medium), indicating a localized privilege/integrity issue requiring an existing authenticated SSH session. Enterprise environments relying on internal-sftp argument tuning for jail enforcement or file operation restrictions are at risk of policy bypass, potentially exposing sensitive files or permitting unauthorized file operations (upload, delete, rename) outside the intended scope.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Technical Analysis

The vulnerability resides in the argument handling routine of internal-sftp, which is implemented within the OpenSSH source tree (typically sftp-server.c or a dedicated internal module). The flaw is a classic argument truncation defect: the code parses options passed from sshd's Subsystem sftp internal-sftp directive (or the -o override in sshd_config) but stops processing after the 9th argument (argv[9]). This is likely due to a hardcoded array size or a loop boundary condition that fails to iterate beyond a fixed count, either because the developer assumed a maximum option count or because a for loop uses i < 9 instead of i < argc.

From a code standpoint, an administrator's sshd_config might contain:

Subsystem sftp internal-sftp -d /srv/sftp/%u -u 0022 -R -l INFO -f AUTH -m 0750

If an attacker can influence the configuration (e.g., through a chained misconfiguration or a user-modifiable setting), or if the argument list naturally exceeds 9 entries, the 10th argument (e.g., -m 0750 restricting file creation modes) would be ignored. In a default installation, internal-sftp usually receives 1–3 arguments, so the vulnerability is only reachable in complex, security-hardened deployments where many flags are stacked.

The attack surface is authenticated, interactive SFTP sessions. An attacker must first authenticate as a valid user (or compromise a low-privilege account). The impact is a security-policy bypass: the SFTP server behaves as if restrictive flags were absent, allowing operations that the administrator explicitly tried to forbid. For example, if -d /home/%u (chroot to user's home) is the 10th argument and ignored, the user can traverse to /etc, /var, or other users' directories. If -u 0022 (umask) is ignored, file permissions may default to system-wide umask (e.g., 0022 resulting in world-readable files), leaking sensitive data.

The CWE identifier is unknown per CVE data; based on the mechanism, it aligns most closely with CWE-1395: Dependency on Vulnerable Third-Party Component if linked to a bundled library, but more precisely CWE-193: Off-by-One Error or CWE-124: Buffer Underwrite if the truncation stems from an index miscalculation. Given the functional behavior (ignoring arguments, not a memory corruption), we assess it as CWE-20: Improper Input Validation — specifically, failure to validate the complete argument vector before use. No memory corruption is indicated; the impact is purely logical.

Exploitation Scenarios

Scenario 1: Chroot Escalation via Argument Truncation (Authenticated User)

  1. Reconnaissance: An attacker with a valid low-privilege SSH account identifies the target as an OpenSSH server via banner (SSH-2.0-OpenSSH_10.2) and probes SFTP behavior (sftp user@host). They run pwd on login; if it returns something other than / or the home directory, they suspect internal-sftp with custom arguments.
  2. Trigger Setup: The attacker checks sshd_config (if readable via misconfiguration or local file disclosure) to see if the Subsystem sftp line is long (≥ 10 arguments). They note the position of security-relevant flags (e.g., -d, -u, -m).
  3. Weaponization: The attacker initiates an SFTP session. Because the vulnerable parser ignores arguments beyond argv[9], any chroot directive (-d) in that position is not enforced at session setup.
  4. Payload/Execution: The attacker runs cd /etc or cd /home/otheruser and then get sshd_config or put malicious_shell.sh. The SFTP server, running without the chroot, honors the path traversal.
  5. Post-Exploitation: The attacker exfiltrates sensitive configuration (e.g., /etc/shadow if perms allow), places a malicious file in another user's home (if write perms align), or uploads a file that a cron job later executes — pivoting to lateral movement or privilege escalation.

Scenario 2: Umask/File-Mode Bypass for Data Exfiltration

  1. Reconnaissance: Attacker enumerates the sshd_config (readable via world-readable ACL or prior foothold) and sees the SFTP subsystem configured with -u 0077 (restrictive umask) as the 12th argument.
  2. Trigger Setup: The attacker uploads a file containing sensitive data (e.g., a database dump already accessible to their account) via SFTP.
  3. Weaponization: Due to truncation, the -u 0077 is ignored; the server applies the default umask (e.g., 0022), creating the file with 0644 permissions instead of 0600.
  4. Payload/Execution: The attacker moves the file to a world-readable directory (e.g., /tmp) and confirms permissions via chmod if needed, but the upload itself already created a world-readable file.
  5. Post-Exploitation: The attacker defers—another low-privilege user (or a service account scanning for *.sql in /tmp) picks up the file, providing an alternative data access path that bypasses the restrictive umask policy.

Scenario 3: Log/Uplog Disablement (Operational Disruption)

  1. Reconnaissance: Attacker knows the organization uses -l VERBOSE (log level) as the 10th argument to enable detailed SFTP audit logs.
  2. Trigger Setup: Any SFTP session will fail to enable verbose logging.
  3. Weaponization: The attacker performs a series of file deletions and renames designed to avoid detection (since logs are not capturing the operations).
  4. Payload/Execution: The attacker deletes the authorized_keys file of a colleague or removes critical application files, then exits.
  5. Post-Exploitation: The security team lacks audit trails for the specific actions, delaying incident response and attribution.

Impact Assessment

  • CVSS Score: 4.2 (Medium) — The vector is not provided in the CVE data; we infer: AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N (high attack complexity due to the need for a specifically configured instance, low privilege requirement for authenticated SFTP, limited CIA impact). The Medium rating reflects that exploitation is environment-dependent and requires a non-default configuration.
  • Business Impact: For organizations using internal-sftp with layered argument-based controls (chroot, umask, log levels), the truncation silently disables the later flags, creating a security-policy gap. This can lead to:
    • Confidentiality breach: Unauthorized read access to files outside the intended chroot.
    • Integrity violation: Unauthorized file write/delete/rename operations.
    • Audit failure: Loss of detailed SFTP logs, hampering compliance (e.g., PCI DSS, SOC 2) and forensic investigations.
  • Affected Systems: Any OpenSSH server (< 10.4) with Subsystem sftp internal-sftp configured with a flag list whose critical options appear at position 10 or later. Also relevant for deployments using ForceCommand internal-sftp with multiple options in authorized_keys.
  • Blast Radius: Single SFTP subsystem per affected host. The impact is per-user, authenticated; it does not yield root access directly but can provide file-level access that may lead to credential harvesting (reading .ssh/authorized_keys or config files) and lateral movement. In multi-tenant hosting environments (shared servers with many users), the chroot bypass could expose one tenant's data to another.

Detection Guidance

Sigma Rule

title: OpenSSH internal-sftp Argument Truncation - Chroot Bypass Detection
id: 44a12c3e-5f9b-4c01-8d4a-7e97b2a1e00c
status: experimental
description: Detects SFTP sessions attempting to access paths outside the expected chroot, indicating possible CVE-2026-59997 exploitation.
logsource:
  product: linux
  service: sshd
  definition: 'Requirements: sshd configured with internal-sftp and auth logging (ssh -l VERBOSE).'
detection:
  selection_root_access:
    - data: 'sftp: realpath "/*"'
    - data: 'sftp: stat name "/etc/*"'
    - data: 'sftp: open "/etc/*"'
    - data: 'sftp: opendir "/"'
  condition: selection_root_access
falsepositives:
  - Admin SFTP sessions where chroot is intentionally disabled
  - Misconfigured SFTP clients that normalize paths
level: high
tags:
  - attack.t1190
  - attack.initial_access
  - cve.2026.59997

YARA Rule

rule openssh_internal_sftp_truncation
{
    meta:
        author = "ValtersIT Threat Intel"
        description = "Detects strings associated with OpenSSH internal-sftp argument parsing flaw (CVE-2026-59997)"
        date = "2026-01-15"
        cve = "CVE-2026-59997"
        severity = "medium"
    strings:
        $sftp_marker = "internal-sftp" nocase
        $sftp_start = "sftp-server" nocase
        $arg_loop = "argc" nocase ascii
        $arg_bound = "argv[9]" ascii
        $chroot_flag = "-d" ascii
        $umask_flag = "-u" ascii
        $more_flags = "-m" ascii
    condition:
        (uint16(0) == 0x5A4D or uint32(0) == 0x464c457f) and
        any of ($sftp*) and
        any of ($arg_loop*) and any of ($arg_bound*) and
        (any of ($chroot_flag*) or any of ($umask_flag*) or any of ($more_flags*))
}

Suricata IDS Rule

alert tcp any any -> $HOME_NET 22 (msg:"ET EXPLOIT OpenSSH internal-sftp Argument Truncation Chroot Bypass Attempt"; flow:established,to_server; content:"SSH-"; depth:4; content:"|00 00 00|"; dsize:>50; content:"SFTP"; nocase; content:"realpath"; nocase; distance:0; content:"/etc/"; nocase; within:20; classtype:attempted-user; sid:20265997; rev:1; metadata:cve CVE-2026-59997;)

Elastic Detection

// EQL query for Elastic Security
sequence by process.entity_id with maxspan=5m
  [process where event.action == "exec" and process.name : "sshd" and process.args : "internal-sftp"]
  [file where event.action in ("open", "read") and file.path : ("/etc/*", "/var/*", "/home/*") and not file.path : ("/home/*/sftp/*", "/var/sftp/*")]

Splunk SPL Query

index=linux sourcetype=sshd "SFTP" "realpath" "/" 
| stats count by user src_ip host, _time 
| where count > 10 
| join type=inner user [search index=linux sourcetype=sshd "chroot" OR "session opened" | stats values(host) as chroot_servers by user]

Wazuh OSSEC Rule

<group name="openssh,">
  <rule id="346643" level="10">
    <decoded_as>sshd</decoded_as>
    <match>sftp: realpath</match>
    <regex>"/etc/|/var/|/root/|/bin/"</regex>
    <description>CVE-2026-59997: SFTP chroot bypass - access to sensitive path detected</description>
    <mitre>
      <id>T1190</id>
    </mitre>
    <group>authentication_success,pci_dss_10.2.4,</group>
  </rule>
</group>

Mitigation & Patch Guidance

Patch Confidence: 2/4 — CLAIMED (a single source (OSV) references a patched version; not independently confirmed by the vendor advisory as of this report's date).

Immediate Mitigations (no patch deployed yet):

  1. Audit configuration: Review all sshd_config files for Subsystem sftp internal-sftp lines. Count the arguments. If more than 9 arguments (including the internal-sftp binary name) appear, identify which flags fall at positions 10+ and reorder so critical security flags (-d, -u, -m, -l) appear within the first 9 arguments.
  2. Restrict access: Temporarily disable Subsystem sftp internal-sftp and use the standalone sftp-server binary (e.g., Subsystem sftp /usr/lib/openssh/sftp-server -d /chroot/%u) which does not suffer from this truncation flaw.
  3. Enforce chroot at the OS level: If internal-sftp is required, wrap the SFTP session in a ChrootDirectory directive (via Match group sftp blocks) to provide a second layer of confinement independent of argument parsing.
  4. Monitor: Enable verbose logging (LogLevel VERBOSE) and deploy an HIDS rule (e.g., the Wazuh rule above) to flag anomalous SFTP path access.

Patch/Upgrade Steps:

  1. Identify current version: Run sshd -V (or ssh -V) to check the OpenSSH version. If it is < 10.4, the server is vulnerable.
  2. Upgrade: Install the latest OpenSSH package version that includes the fix (≥ 10.4). For most Linux distributions (Debian/Ubuntu: sudo apt upgrade openssh-server; RHEL/CentOS/Fedora: sudo dnf update openssh-server; FreeBSD: pkg upgrade openssh-portable), the package manager will fetch the patched build. No package manager applies to OpenSSH as it is a system daemon, not a Perl/Ruby/Python/Go/Rust/Node.js package.
  3. Verify the fix: After upgrading, re-run a configuration with 10+ arguments and confirm the 10th argument (e.g., -d /chroot) is now honored by creating a session and attempting cd / — it should fail with "Permission denied" if the chroot is enforced.
  4. Test: Restart sshd (sudo systemctl restart sshd) and re-test SFTP for all user groups.

Long-Term Hardening:

  1. Adopt defense-in-depth: Always use ChrootDirectory in combination with internal-sftp; never rely on a single flag for containment.
  2. Standardize SFTP configuration templates with a maximum of 5–7 arguments to avoid hitting the truncation threshold.
  3. Implement file integrity monitoring (e.g., Wazuh FIM, Auditd) on sensitive directories to catch unauthorized file reads/writes.
  4. Subscribe to vendor security feeds (OpenSSH mailing list, CERT/CC) to receive early advisories before CVE publication.

References

Threat Actor Campaigns / Exploit-in-the-Wild: As of this report, CISA KEV indicates NO known exploitation in the wild. OSV lists a single claimed patch source; no public exploit code or Nuclei template exists. This is a high-complexity, low-RCE-value flaw limited to authenticated users and specific configurations, making it an unlikely target for automated campaigns; however, nation-state actors with SSH footholds could leverage it in targeted operations against hardened SFTP servers.


Report generated for Valters IT — Threat Intelligence Division. Distribution: TLP:CLEAR.

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2026-59997/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.