PT-2025-40939 · Openbsd +1 · Openssh +1
David Leadbeater
·
Published
2025-10-06
·
Updated
2025-11-28
·
CVE-2025-61984
CVSS v3.1
3.6
3.6
Low
| Base vector | Vector | AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N |
Name of the Vulnerable Software and Affected Versions
OpenSSH versions prior to 10.1
Description
OpenSSH, prior to version 10.1, contains a flaw related to the handling of usernames with control characters when used with the
ProxyCommand feature. This can lead to remote code execution. The issue arises because OpenSSH does not properly sanitize usernames originating from untrusted sources, such as the command line or through expansion of configuration files. Specifically, the vulnerability allows an attacker to inject commands into the ProxyCommand execution flow by crafting a username containing control characters like newlines. When a shell processes the ProxyCommand, the injected commands can be executed, potentially leading to a full system compromise. The vulnerability is particularly dangerous when ProxyCommand is used in environments like CI/CD pipelines, bastion hosts, or with Git submodules. Exploitation can result in credential theft and complete control of the client host. The ProxyCommand feature executes commands using 'exec %s', and the vulnerability stems from the shell's handling of syntax errors caused by the injected control characters.Recommendations
Upgrade OpenSSH to version 10.1 or later.
Disable or limit the use of the
ProxyCommand feature if an immediate upgrade is not possible.
Require jump-hosts or bastions to restrict access and minimize the attack surface.
Enforce strict AllowUsers and Match blocks in the SSH configuration to limit authorized users and connections.
Force non-interactive shells for SSH helper processes to prevent command injection.
Review SSH logs (auth.log) for unusual ProxyCommand invocations and suspicious activity.
Rotate SSH keys as a precautionary measure.
Tighten ingress access control lists (ACLs) to restrict network access to SSH.
Treat potentially exposed hosts as compromised until proven otherwise.Exploit
Fix
RCE
Found an issue in the description? Have something to add? Feel free to write us 👾
dbugs@ptsecurity.com
Weakness Enumeration
Related Identifiers
BDU:2025-12884
CVE-2025-61984
ECHO-8420-5303-4F71
JLSEC-2025-7
OESA-2025-2582
OESA-2025-2583
OESA-2025-2584
OESA-2025-2585
OESA-2025-2586
OESA-2025-2646
Affected Products
Debian
Openssh
References · 81
- 🔥 https://github.com/dgl/cve-2025-61984-poc⭐ 4 🔗 9 · Exploit
- 🔥 https://dgl.cx/2025/10/bash-a-newline-ssh-proxycommand-cve-2025-61984 · Exploit
- https://bdu.fstec.ru/vul/2025-12884 · Security Note
- https://security-tracker.debian.org/tracker/CVE-2025-61984 · Vendor Advisory
- https://osv.dev/vulnerability/BELL-CVE-2025-61984 · Vendor Advisory
- https://nvd.nist.gov/vuln/detail/CVE-2025-61984 · Security Note
- https://ubuntu.com/security/CVE-2025-61984 · Vendor Advisory
- https://osv.dev/vulnerability/ALPINE-CVE-2025-61984 · Vendor Advisory
- https://nvd.nist.gov/vuln/detail/CVE-2025-61985 · Security Note
- https://osv.dev/vulnerability/UBUNTU-CVE-2025-61984 · Vendor Advisory
- https://osv.dev/vulnerability/OESA-2025-2646 · Vendor Advisory
- https://osv.dev/vulnerability/DEBIAN-CVE-2025-61984 · Vendor Advisory
- https://osv.dev/vulnerability/OESA-2025-2586 · Vendor Advisory
- https://osv.dev/vulnerability/OESA-2025-2584 · Vendor Advisory
- https://osv.dev/vulnerability/JLSEC-2025-7 · Vendor Advisory