CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2025-61984

OpenSSH Username Control Character Injection

Alon Barad
Alon Barad
Software Engineer

Feb 28, 2026·7 min read·133 visits

Executive Summary (TL;DR)

OpenSSH clients < 10.1 allow control characters in usernames. Attackers can inject newlines and shell syntax errors into a username (e.g., via a malicious git URL). When processed by `ProxyCommand`, this bypasses shell validation and executes arbitrary code on the victim's machine.

A critical input validation vulnerability exists in the OpenSSH client (versions prior to 10.1) regarding the handling of usernames. Specifically, the software fails to properly filter control characters, such as newlines, from user-supplied identity strings. When these usernames are expanded in configuration directives like 'ProxyCommand', the injected control characters can alter the structure of the command being executed by the underlying shell. This allows an attacker to inject arbitrary shell commands, leading to Remote Code Execution (RCE) on the client machine, provided specific shell behaviors and configuration conditions are met.

Vulnerability Overview

CVE-2025-61984 represents a subtle but significant flaw in how the OpenSSH client validates user identity inputs before passing them to the operating system's shell. The core issue resides in the ssh client's command-line argument parsing and configuration expansion logic. When a user initiates a connection, or when an automated tool (such as Git) invokes SSH, the username is often passed as a parameter. OpenSSH creates a command string based on the ssh_config file, expanding tokens like %r (remote username) into the final command line.

Prior to version 10.1, the OpenSSH client enforced a deny-list for certain dangerous shell metacharacters but failed to account for ASCII control characters, specifically the newline character (\n or 0x0A). This oversight turns the username field into a vector for argument injection. If an attacker can manipulate the username—for example, by forcing a user to connect to a specific URL or cloning a malicious repository—they can introduce multi-line payloads into the command buffer.

While the CVSS score is technically Low (3.6) due to the complexity of exploitation (requiring specific ProxyCommand configurations and victim interaction), the functional impact is critical. Successful exploitation results in arbitrary code execution in the context of the user running the SSH client. This places developer workstations and CI/CD pipelines at particular risk, as they frequently process untrusted URLs via Git submodules.

Root Cause Analysis

The vulnerability stems from the valid_ruser function within ssh.c. This function is responsible for sanitizing usernames to ensure they are safe for use in shell commands. Historically, this validation logic focused on preventing standard shell injection attacks by blocking characters such as backticks, semicolons, and ampersands. However, the logic explicitly allowed the full range of ASCII control characters (0x00–0x1F), assuming they were benign or would be handled correctly by downstream components.

When ssh_config utilizes the ProxyCommand directive, OpenSSH typically constructs a command string that looks like exec <proxy_command> <flags> %r@%h. The use of exec is intended to replace the shell process with the proxy process, ensuring clean signal handling and resource management. If a username contains a newline, the single exec command is split into two separate lines of shell code.

Crucially, the exploitation relies on the error-handling behavior of specific shells, particularly Bash. If the first line of the injected command contains a syntax error (which the attacker intentionally induces), certain non-interactive shell invocations will discard the failed line and proceed to execute the subsequent lines. This behavior, sometimes referred to as 'fail-open' on syntax errors in specific execution contexts, allows the injected payload on the second line to run despite the initial command failure.

Code Analysis: The Missing Check

The remediation for CVE-2025-61984 is concise, highlighting the exact nature of the oversight. The fix introduces a check using iscntrl() to reject any username containing control characters. Below is the comparison of the vulnerable and patched code in ssh.c.

Vulnerable Code (Prior to 10.1):

The original loop iterated through the username string s, checking only for a hardcoded set of dangerous characters. It permitted everything else, including \n.

/* ssh.c - valid_ruser function */
for (i = 0; s[i] != 0; i++) {
    // Only checks for specific shell metacharacters
    if (strchr("'`\";&<>|(){}", s[i]) != NULL)
        return 0;
}
return 1;

Patched Code (Version 10.1):

The patch adds an immediate check for control characters at the beginning of the loop. If iscntrl returns true for any character (casted to u_char to handle signedness correctly), the username is rejected immediately.

/* ssh.c - valid_ruser function */
for (i = 0; s[i] != 0; i++) {
    // FIX: Reject control characters (0x00-0x1F, 0x7F)
    if (iscntrl((u_char)s[i]))
        return 0;
    if (strchr("'`\";&<>|(){}", s[i]) != NULL)
        return 0;
}
return 1;

This simple addition effectively neutralizes the attack vector by ensuring that the username cannot break out of the single-line command structure expected by the ProxyCommand expansion.

Exploitation Mechanics

To exploit this vulnerability, an attacker must construct a payload that achieves two goals: injecting a newline to break the command structure, and neutralizing the prefix of the command to ensure execution flow continues to the payload.

The Payload Structure

A standard ProxyCommand expansion results in: exec proxy_binary %r@%h. If the username (%r) is injected with $[+]\npayload, the shell sees:

  1. exec proxy_binary $[+]
  2. payload@host

The sequence $[+] is a deliberate arithmetic syntax error in Bash. In the context of ssh executing a command via $SHELL -c, this syntax error causes the first line to fail. However, because it is a syntax error rather than a command-not-found error, Bash (in this specific execution mode) may advance to the next line rather than exiting immediately.

Attack Vector: Malicious Git Submodules

The most viable delivery mechanism is a malicious Git repository. An attacker creates a .gitmodules file defining a submodule with the crafted username in the URL.

[submodule "exploit"]
    path = exploit
    url = "ssh://$[+]\ncalc.exe\n@attacker.com/repo"

When a victim runs git clone --recursive <malicious-repo>, Git invokes SSH to clone the submodule. OpenSSH parses the URL, extracts the malicious username, and if the victim's SSH config uses ProxyCommand with %r, the payload calc.exe is executed on the victim's machine.

Impact Assessment

The impact of CVE-2025-61984 is context-dependent but potentially severe. While the default configuration of OpenSSH does not typically use ProxyCommand, it is a very common configuration for users accessing corporate networks via jump hosts or using tools like Teleport (tsh).

Confidentiality and Integrity: An attacker who successfully exploits this can execute arbitrary commands with the privileges of the local user. This allows for the exfiltration of SSH keys, signing certificates, and local files. It also permits the modification of source code or the installation of persistence mechanisms (backdoors).

Availability: While denial of service is possible (e.g., rm -rf ~), it is rarely the primary goal of such an attack. The primary risk is the silent compromise of developer environments, which serves as a pivot point for supply chain attacks.

Affected Shells: The vulnerability specifically impacts users whose default shell allows the syntax-error bypass (e.g., Bash, Fish, Csh). Users running Zsh are generally immune because Zsh enforces stricter parsing and exits immediately upon encountering the syntax error in the first line.

Mitigation and Remediation

The primary and most effective mitigation is to upgrade the OpenSSH client. This vulnerability is completely resolved in OpenSSH 10.1. Users on Linux distributions should apply vendor-supplied patches immediately via their package managers (e.g., apt upgrade openssh-client, dnf update openssh-clients).

Configuration Workaround

For systems that cannot be immediately updated, the vulnerability can be mitigated by modifying the ~/.ssh/config or /etc/ssh/ssh_config files. The goal is to ensure that the expanded username is enclosed in quotes, preventing the shell from interpreting the newline as a command separator.

Change directives using %r from: ProxyCommand /usr/bin/nc -X connect -x proxy:8080 %h %p %r

To: ProxyCommand /usr/bin/nc -X connect -x proxy:8080 %h %p '%r'

Defensive Git Configuration

To prevent the specific vector of malicious Git submodules, developers can restrict which protocols Git is allowed to use. Disabling SSH for submodules or restricting it to known users can reduce the attack surface:

git config --global protocol.ssh.allow user

Official Patches

OpenSSHOpenSSH 10.1 Release Notes

Fix Analysis (1)

Technical Appendix

CVSS Score
3.6/ 10
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N
EPSS Probability
0.01%
Top 99% most exploited

Affected Systems

OpenSSH Client < 10.1Systems using ProxyCommand with unquoted %rGit (via submodule cloning using SSH)

Affected Versions Detail

Product
Affected Versions
Fixed Version
OpenSSH
OpenBSD
< 10.110.1
AttributeDetail
CWE IDCWE-159
Attack VectorLocal (User Interaction)
CVSS Score3.6 (Low)
CVSS VectorCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N
EPSS Score0.00008
Exploit StatusPoC Available

MITRE ATT&CK Mapping

T1059.004Command and Scripting Interpreter: Unix Shell
Execution
T1204.002User Execution: Malicious File
Execution
CWE-159
Improper Handling of Invalid Use of Special Elements

Improper Handling of Invalid Use of Special Elements

Known Exploits & Detection

GitHubProof of concept demonstrating RCE via ProxyCommand injection

Vulnerability Timeline

Vulnerability disclosed and OpenSSH 10.1 released
2025-10-06
Detailed PoC and write-up published by David Leadbeater
2025-10-07
Major Linux distributions release patched packages
2025-12-01

References & Sources

  • [1]Technical Analysis by David Leadbeater

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2026-68586
9.2

CVE-2026-68586: Missing Authorization in SiYuan Backlink Content Endpoints Allows Information Disclosure

SiYuan is a privacy-first personal knowledge management system. In versions prior to v3.7.3, the application fails to apply publish-access filters to the getBacklinkDoc and getBackmentionDoc content endpoints (/api/ref/getBacklinkDoc and /api/ref/getBackmentionDoc). While the corresponding backlink list endpoints correctly filter out publish-forbidden documents, the content endpoints, which are only gated by high-level route authorization checks via CheckAuth, do not. Consequently, a user with low-privilege read access, or an anonymous reader when publish Basic Auth is disabled, can directly invoke these endpoints using a known publish-forbidden document's ID to retrieve its rendered DOM content or determine whether it references a specific target block.

Amit Schendel
Amit Schendel
1 views•7 min read
•about 2 hours ago•CVE-2026-68585
5.8

CVE-2026-68585: Metadata Disclosure via Missing Authorization in SiYuan API

A metadata disclosure vulnerability exists in SiYuan prior to version v3.7.3. The /api/block/getBlockInfo endpoint fails to validate authorization boundaries in publish mode, allowing anonymous readers to access private document metadata.

Alon Barad
Alon Barad
2 views•8 min read
•about 3 hours ago•CVE-2026-72812
6.5

CVE-2026-72812: Broken Access Control and SQL Injection in SiYuan

A critical authorization bypass vulnerability exists in SiYuan personal knowledge management system before v3.7.4. The /api/ref/refreshBacklink endpoint lacks administrative role verification, enabling unauthenticated users to initiate database transactions and disk operations. When combined with an unsafe SQL generation pattern in nested backlink queries, an attacker can exploit a secondary SQL injection vulnerability to compromise local databases or cause denial-of-service conditions.

Amit Schendel
Amit Schendel
3 views•6 min read
•about 4 hours ago•CVE-2026-72811
10.0

CVE-2026-72811: Remote SQL Injection in SiYuan Backlink and Mention Search Engine

A critical SQL Injection vulnerability exists in the SiYuan note-taking application (versions <= v3.7.2) due to improper neutralization of single quotes within the backlink and mention search queries. Because the application constructs SQLite Full Text Search (FTS) queries via direct string concatenation and uses a database driver that supports stacked query statements, remote unauthenticated attackers can execute arbitrary SQL commands on the master database, compromising all hosted notebooks. This issue has been fully remediated in version v3.7.4.

Amit Schendel
Amit Schendel
3 views•7 min read
•about 5 hours ago•CVE-2026-72810
8.6

CVE-2026-72810: Publish-Boundary Bypass and Real-Time Data Leakage via WebSocket Session Pollution in SiYuan

CVE-2026-72810 is a critical publish-boundary bypass vulnerability in the SiYuan personal knowledge management system before version 3.7.4. The flaw lies in the backend real-time WebSocket broadcast mechanism. When configured in public publish mode, the system fails to differentiate between unauthenticated public reader sessions and authorized administrative sessions within its global connection pool. This architectural oversight allows unauthenticated remote attackers connecting to the public WebSocket endpoint on port 6808 to passively receive real-time, raw workspace modification events, including keystroke logs, block updates, and content from protected or forbidden documents.

Amit Schendel
Amit Schendel
4 views•7 min read
•about 6 hours ago•CVE-2026-72809
8.0

CVE-2026-72809: Authentication Bypass in SiYuan via Localhost Trust Spoofing

An authentication bypass vulnerability exists in the SiYuan personal knowledge management system (versions <= v3.7.2). The flaw occurs because the kernel's authorization validation handler trusts loopback connection origins blindly, allowing remote network attackers to gain administrative privileges via an exposed local reverse proxy.

Alon Barad
Alon Barad
4 views•6 min read