Reach openssh · 8 builds in 4 of 4 releases
full reviewcross-check✓ a member decided
Description · NVD
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.
Published 2026-08-11NVD
CVSS 3.1Network · no privileges · no user interaction
How it is reached
- Attack vector
- Network
- Attack complexity
- High
- Privileges required
- None
- User interaction
- None
What it costs
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
- Scope
- Unchanged
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
References 1
Fable 5.1 · medium confidence · 2026-11-05
The vulnerable client-side code is present and unpatched: ssh.c registers a raw pointer into options.remote_forwards as the global-request confirm context (ssh.c:2042-2044), while a mux "forward" request (mux.c:820-828 -> readconf.c add_remote_forward, xreallocarray at readconf.c:417) can reallocate that array before the server's reply arrives, so ssh_confirm_remote_forward (ssh.c:1845) dereferences freed memory.
None of the 18 Buildroot patches touch this (they address CVE-2025-6198x / CVE-2026-35xxx / CVE-2026-599xx/600xx), and version.h is OpenSSH_9.9p2, below the 10.5 fix.
However, the only product-driven use of the ssh client is the CLI "ssh" command, which execs plain ssh [-l user] [-p port] host (infix.c:708-713) with no -R, no ControlMaster and no -O mux client, and the ~C escape path (clientloop.c:1090) does not reallocate the array. Triggering requires an operator to hold an unrestricted UNIX shell on the device and manually run a ControlMaster session with a pending -R forward plus a concurrent ssh -O forward -R against a cooperating/malicious remote SSH server; no finit service, YANG node or CLI command drives that path.
Evidence 12
Source is OpenSSH_9.9p2; CVE fixed in 10.5.
output/build/openssh-9.9p2/version.h:3-6
18 patches applied, all for other CVEs (2025-61984/61985, 2026-35385..35414, 2026-59995..60002); none references this issue or touches ssh.c remote-forward confirm handling.
output/build/openssh-9.9p2/.applied_patches_list
client_register_global_confirm(ssh_confirm_remote_forward, &options.remote_forwards[i]) stores a raw pointer into a reallocatable array.
output/build/openssh-9.9p2/ssh.c:2039-2044
add_remote_forward() xreallocarray()s options.remote_forwards, invalidating outstanding callback pointers.
output/build/openssh-9.9p2/readconf.c:417-420
Mux 'forward' request (ssh -O forward -R) calls channel_request_remote_forwarding then add_remote_forward while earlier confirms may be pending — the concurrent remote-forward pair.
output/build/openssh-9.9p2/mux.c:820-828
ssh_confirm_remote_forward dereferences the stale rfwd pointer when the server reply arrives (the UAF read/write).
output/build/openssh-9.9p2/ssh.c:1845-1890
ssh client binary is installed in the target image.
output/.config (BR2_PACKAGE_OPENSSH_CLIENT=y); output/target/usr/bin/ssh
CLI 'ssh' command execs only `ssh [-l user] [-p port] host`; no -R, -M/-S ControlMaster or -O options.
src/klish-plugin-infix/src/infix.c:708-713
CLI ssh command exposes only user/port/host parameters; no forwarding options.
src/klish-plugin-infix/xml/infix.xml:1200-1211
Interactive ~C -R escape calls channel_request_remote_forwarding without add_remote_forward, so it does not reallocate options.remote_forwards.
output/build/openssh-9.9p2/clientloop.c:1088-1093
Only mstpd, netconf, rauc enabled; no service runs the ssh client (sshd is the server and is not the affected component).
board/common/rootfs/etc/finit.d/enabled/
Only route to the vulnerable path is giving a user shell=bash/sh (default false) and then manually running ControlMaster + concurrent -O forward -R; this is an unrestricted shell, not a product feature.
src/confd/yang/confd/infix-system.yang:596-604
Version and patches
Affected: OpenSSH ssh client < 10.5; fixed in 10.5. This tree: 9.9p2 with 18 Buildroot patches, none addressing this CVE; the vulnerable pointer-into-realloc'd-array pattern is present in ssh.c/readconf.c/mux.c. The affected component is the ssh client (not sshd); it is built (BR2_PACKAGE_OPENSSH_CLIENT=y) and installed at /usr/bin/ssh.
Recommendation
Document as not exposed on shipped devices; pick up the fix with the next OpenSSH bump (10.5+) or backport the 10.5 ssh.c/readconf.c change at low priority. No urgent action: the race needs an operator with an unrestricted shell running a ControlMaster session with concurrent remote-forward operations against a malicious SSH server, which the product's CLI ssh command cannot do.
Open questions
The exact upstream 10.5 fix commit could not be fetched offline, so the identification of the realloc site (options.remote_forwards via mux add_remote_forward) is based on code inspection; if the fix also covers a different concurrent pair (e.g. a cancel racing a confirm), the reachability conclusion is unchanged since both still require ControlMaster/mux or escape-sequence use absent from the product's ssh invocation.
Members of Kernel Kit decide. Sign in if you are one.