A flaw was found in OpenSSH. A username entered on the ssh command line can still contain '$' or a non-trailing backslash. When a configuration expands %u inside ProxyCommand or Match exec, those characters are passed into the shell.
Credits
Red Hat would like to thank SecBuddyF (KeenLab) for reporting this issue.