# CVE-2026-35386: OpenSSH command injection via shell metacharacters in username

Source: https://junglewise.ai/threats/cve-2026-35386-openssh-command-injection-via-shell-metacharacters-in-username  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-04-02. Updated: 2026-07-07  
License: CC BY 4.0 with a link back

CVE-2026-35386 · Severity: low · CVSS 3.6 · Published 2026-04-02

OpenSSH, a widely used tool for secure remote access, contains a vulnerability that could allow an attacker to execute unauthorized commands. This occurs when a user provides a specially crafted username containing shell characters to the SSH client. For an exploit to succeed, the system must be using a specific, non-default configuration that processes usernames in a way that triggers the command execution.

Technologies: [OpenBSD Openssh](https://junglewise.ai/threats/technologies/openssh). Vendors: [OpenBSD](https://junglewise.ai/threats/vendors/openbsd).

## Quick answers

**Is CVE-2026-35386 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-35386 being exploited in the wild.

**How severe is CVE-2026-35386?** Low severity, with a CVSS score of 3.6, published 2 April 2026.

**Which products and versions are affected?** OpenBSD Openssh before 10.3.

**Is there a fix for CVE-2026-35386?** A patch was published on 2026-04-02: Fixed in OpenSSH 10.3/10.3p1 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-35386 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-35386?** Check whether you run OpenBSD Openssh at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A command injection vulnerability exists in OpenSSH client (ssh) versions prior to 10.3. The flaw is caused by insufficient validation of shell metacharacters in usernames supplied via the command line, which are processed too late to prevent expansion from %-tokens (such as %u) in ssh_config. An attacker who can control the username passed to the ssh command can achieve arbitrary command execution if the configuration uses these tokens within a 'Match exec' block. This is considered a low-severity issue as it requires a non-default configuration and the ability to provide untrusted input to the command-line arguments. The issue is addressed in OpenSSH 10.3.

## Affected products

- OpenBSD OpenSSH before 10.3

## Timeline

- 2026-04-02: disclosed
- 2026-04-02: patched: Fixed in OpenSSH 10.3/10.3p1

## References

- [https://marc.info/?l=openssh-unix-dev&m=177513443901484&w=2](https://marc.info/?l=openssh-unix-dev&m=177513443901484&w=2)
- [https://www.openssh.org/releasenotes.html](https://www.openssh.org/releasenotes.html)
- [https://www.openwall.com/lists/oss-security/2026/04/02/3](https://www.openwall.com/lists/oss-security/2026/04/02/3)

## Related threats

- [OpenSSH password authentication bypass on musl libc without PAM](https://junglewise.ai/threats/cve-2026-123158-sshd-in-openssh-before-10-6p2-on-linux-when-musl-libc-is-used)
- [In sshd in OpenSSH before 10.5, the restrict keyword (in authorized_keys) was supposed to be applicable to tunnel forwarding but was not.](https://junglewise.ai/threats/cve-2026-73283-in-sshd-in-openssh-before-10-5-the-restrict-keyword-in-authorized)
- [In ssh in OpenSSH before 10.5, a use-after-free for realloc data can occur if a certain pair of remote-forwarding operations are concurrent.](https://junglewise.ai/threats/cve-2026-73282-in-ssh-in-openssh-before-10-5-a-use-after-free-for-realloc-data)
- [In ssh-agent in OpenSSH before 10.5, some operations can occur remotely but were intended to occur only locally…](https://junglewise.ai/threats/cve-2026-73281-in-ssh-agent-in-openssh-before-10-5-some-operations-can-occur)
- [OpenSSH use-after-free in ssh client during key re-exchange](https://junglewise.ai/threats/cve-2026-60002-openssh-use-after-free-in-ssh-client-during-key-re-exchange)
