Value of $SHELL breaks ssh proxyjump during build

Hi,
I'm currently building openwrt firmwares in a let's say 'challenging corporate network environment(tm)' with some custom packages.
The sources for those custom packages reside on our git server and for some bizzare firewalling reasons, our build host needs a couple of proxy jumps before it can access the git server.

That would not be much of a problem, since I can just setup an ssh config with all the jumps in it and git clone should just work.

Except it doesn't when called from inside an OpenWRT package makefile.
The culprit is in the line export SHELL:=/usr/bin/env bash in rules.mk.

Short illustration of the problem (names changed for obvious reasons):

$ cat ./ssh/config
Host git.foo.org
    ProxyJump jumhost.foo.org

$ export SHELL="/usr/bin/env bash"
$ ssh -vvv git@git.foo.org
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /home/foobar/.ssh/config
debug1: /home/foobar/.ssh/config line 1: Applying options for git.foo.org
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Setting implicit ProxyCommand from ProxyJump: ssh -l foobar -vvv -W '[%h]:%p' jumphost.foo.org
debug1: Executing proxy command: exec ssh -l foobar -vvv -W '[git.foo.org]:22' jumhost.foo.org
debug1: permanently_drop_suid: 1004
/usr/bin/env bash: No such file or directory
debug1: identity file /home/foobar/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /home/foobar/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/foobar/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/foobar/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/foobar/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/foobar/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/foobar/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/foobar/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
ssh_exchange_identification: Connection closed by remote host

As you can seen exec, or something after the exec tries spawn the shell using the binary /usr/bin/env bash, which obviously does not exists.
If I'm not mistaken, this line has been in place since 9 years and so far nobody else has encountered this problem (at least I could not find anything via google).

I tried patching it to /bin/bash and my builds work flawlessly.

This raises a two questions:

  1. Is there a particular reasons why the variable is set like this? Will I risk breaking something else if I just change it?
  2. Is this a bug with ssh or a bug with the OpenWRT build process? Are spaces in $SHELL even allowed?