SSH permits user-set environment variables
What this means
PermitUserEnvironment is set to “‹permit user environment›” in sshd_config, letting an SSH client set arbitrary environment variables for its session (via ~/.ssh/environment or SendEnv) — including ones like LD_PRELOAD that can hijack the behavior of programs the session later runs.
How to fix it
Set PermitUserEnvironment no in /etc/ssh/sshd_config and run systemctl restart sshd.
Check it yourself
Run a scan and look for BLWK-SSH-006 in the results:
sh
bulwark scanInstalled the standalone CLI package instead of the app? The command is bulwarkctl.
How Bulwark decides
Bulwark reads sshd_config and reports this check when:
text
permit_user_environment == "yes"If a value can't be read, Bulwark reports the check as undetermined rather than passing it. View the rule source.
References
- CIS Benchmark 5.2.6
Related checks
- SSH password authentication is enabled ·
BLWK-SSH-001 - SSH root login is permitted ·
BLWK-SSH-002 - SSH allows empty passwords ·
BLWK-SSH-003 - SSH X11 forwarding is enabled ·
BLWK-SSH-004 - SSH TCP forwarding/tunneling is enabled ·
BLWK-SSH-005 - SSH tun-device (layer 2/3) tunneling is enabled ·
BLWK-SSH-007