{"description": "The SSH daemon should prevent remote hosts from connecting to the proxy\ndisplay.\n<br />\nThe default SSH configuration for <tt>X11UseLocalhost</tt> is <tt>yes</tt>,\nwhich prevents remote hosts from connecting to the proxy display.\n<br />\nTo explicitly prevent remote connections to the proxy display, add or correct\nthe following line in\n\n\n<tt>/etc/ssh/sshd_config.d/00-complianceascode-hardening.conf</tt>:\n\n<tt>X11UseLocalhost yes</tt>", "rationale": "When X11 forwarding is enabled, there may be additional exposure to the\nserver and client displays if the sshd proxy display is configured to listen\non the wildcard address. By default, sshd binds the forwarding server to the\nloopback address and sets the hostname part of the <tt>DISPLAY</tt>\nenvironment variable to localhost. This prevents remote hosts from\nconnecting to the proxy display.", "severity": "medium", "references": {"nist": ["CM-6(b)"], "srg": ["SRG-OS-000480-GPOS-00227"], "stigid": ["UBTU-22-255045"], "stigref": ["SV-260530r991589_rule"]}, "control_references": {"stigid": ["UBTU-22-255045"]}, "components": [], "identifiers": {}, "ocil_clause": "the display proxy is listening on wildcard address", "ocil": "To determine how the SSH daemon's <tt>X11UseLocalhost</tt> option is set, run the following command:\n\n<pre>$ sudo grep -i X11UseLocalhost /etc/ssh/sshd_config.d/00-complianceascode-hardening.conf</pre>\n<pre>$ sudo grep -i X11UseLocalhost /etc/ssh/sshd_config.d/01-complianceascode-reinforce-os-defaults.conf</pre>\n\nIf a line indicating <tt>yes</tt> is returned, then the required value is set.", "oval_external_content": null, "fixtext": "To configure the system add or modify the following line in \"/etc/ssh/sshd_config.d/00-complianceascode-hardening.conf\".\nX11UseLocalhost yes\nRestart the SSH daemon for the settings to take effect:\n$ sudo systemctl restart sshd.service", "checktext": "", "vuldiscussion": "", "srg_requirement": "The Ubuntu 22.04 SSH daemon must prevent remote hosts from connecting to the proxy display.", "warnings": [], "conflicts": [], "requires": [], "policy_specific_content": {"stig": {"srg_requirement": "Ubuntu 22.04 SSH daemon must prevent remote hosts from connecting to the proxy display.", "vuldiscussion": "When X11 forwarding is enabled, there may be additional exposure to the server and client displays if the sshd proxy display is configured to listen on the wildcard address. By default, sshd binds the forwarding server to the loopback address and sets the hostname part of the \"DISPLAY\" environment variable to localhost. This prevents remote hosts from connecting to the proxy display.", "checktext": "Verify the SSH daemon prevents remote hosts from connecting to the proxy display with the following command:\n\n$ sudo /usr/sbin/sshd -dd 2&gt;&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH '^\\s*x11uselocalhost'\n\nX11UseLocalhost yes\n\nIf the \"X11UseLocalhost\" keyword is set to \"no\", is missing, or is commented out, this is a finding.", "fixtext": "Configure the SSH daemon to prevent remote hosts from connecting to the proxy display.\n\nAdd the following line to \"/etc/ssh/sshd_config\" or to a file in \"/etc/ssh/sshd_config.d\", or uncomment the line and set the value to \"yes\":\n\nX11UseLocalhost yes\n\nThe SSH service must be restarted for changes to take effect:\n\n$ sudo systemctl restart sshd.service"}}, "platform": null, "platforms": [], "sce_metadata": {}, "inherited_platforms": ["system_with_kernel"], "cpe_platform_names": [], "inherited_cpe_platform_names": ["system_with_kernel"], "bash_conditional": null, "fixes": {}, "title": "Prevent remote hosts from connecting to the proxy display", "definition_location": "/aptdata/openscap/scap-security-guide/linux_os/guide/services/ssh/ssh_server/sshd_x11_use_localhost/rule.yml", "template": {"name": "sshd_lineinfile", "vars": {"parameter": "X11UseLocalhost", "value": "yes", "datatype": "string", "is_default_value": "true"}, "backends": {}}}