Revisiting SSH Pass-Through (Re: Subsystem sftp invoked even though forced command created)

MCMANUS, MICHAEL P mm1072 at att.com
Wed Nov 11 06:16:18 AEDT 2026


Folks,

Back in 2023, I started a thread here (reference Message-ID: https://marc.info/?i=CY8PR02MB92013A6E6F52D4F668EDDC9CD0DFA%20()%20CY8PR02MB9201%20!%20namprd02%20!%20prod%20!%20outlook%20!%20com) regarding a Remote Code Execution issue arising from the use of SSH Pass-Through as described in "Secure Automated File Transfer", ;login:, August 2005, pp. 14-17.

In July 2026, a Red Team exercise at my site drew attention to this issue. The key findings with respect to this issue are as follows:

  *   The premise of SSH Pass-Through is the use of a forced command to prevent remote execution of any command other than the forced command. This is supposed to disallow the use of other subsystems such as scp and sftp to bypass the forced command.
  *   Unfortunately, on all Linux distributions (and this appears to be confined to the Linux platform), there appears to be an order of operations problem in which the SFTP subsystem overrides the use of a forced command. This behavior is not replicated on other OS platforms, but as mentioned in the prior thread, it is reproducible even when the OpenSSH source code is re-compiled on a Linux platform from scratch. This indicates (to me at least) that an interaction with glibc or some other fundamental library specific to Linux may be the culprit here.
  *   The Red Team exercise indicated that the RCE issue stems from the ability of the attacker to misuse the embedded private key from the application package to replace the forced command with an executable of one's choosing via sftp.
     *   This indicates a possible mitigation is to require the forced command to be:
     *   outside the home directory of the user tasked with executing the forced command on the remote server,
     *   owned by a different user ID from the one tasked with the upload, and not writable by the latter user, and/or
     *   a compiled binary rather than a script (but that often defeats the purpose of SSH pass-through).
  *   The suggested replacement for SSH pass-through in our current environment is TLS transport with mutual certificate authentication.

I'm sending this in hopes that the clues provided may be sufficient to salvage this useful transport mechanism if possible, with perhaps a deeper dive into the OpenSSH binary build than is possible for just me and my other priorities.

Mike McManus
Principal - Technology Security
EASE-EO Security Governance Team - Unix
P: He/Him/His

AT&T Services, Inc.
20309 North Creek Pkwy, Bothell, WA 98011
michael.mcmanus at att.com<mailto:michael.mcmanus at att.com>



More information about the openssh-unix-dev mailing list