{
  "id": "CB-UBU-SVC-024",
  "standard": "ubuntu",
  "version": "0.1.0",
  "url": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-SVC-024",
  "json": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-SVC-024.json",
  "yaml": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-SVC-024.yml",
  "profiles_effective": [
    "server-hardened"
  ],
  "license": "Text CC BY 4.0, code Apache-2.0",
  "attribution": "CIRSEC Baselines, https://baselines.cirsec.org",
  "control": {
    "id": "CB-UBU-SVC-024",
    "title": "Remove the X Window System server and the GNOME display manager from servers",
    "finding": {
      "title": "An X Window System server or a graphical login manager is installed on a server",
      "description": "A graphical server stack adds a large amount of privileged, rarely needed code."
    },
    "status": "active",
    "profiles": [
      "server-hardened"
    ],
    "risk": {
      "severity": "low"
    },
    "assessment": "automated",
    "tags": [
      "packages",
      "x11",
      "attack-surface"
    ],
    "description": "`xserver-common` holds the files shared by every X.Org server (Xorg, Xvfb, Xephyr, and Xwayland\non Ubuntu). When it is absent, no X server is installed. `gdm3`, the GNOME display manager of\nUbuntu Desktop, starts a graphical login screen as soon as it is installed.\n",
    "rationale": "An X server is complex software, historically run with root privileges, with a long record of\nlocal privilege escalation flaws. A display manager adds a graphical login on the console and\nits own services (accessibility, network manager applets, remote login). A server administered\nover SSH needs neither.\n",
    "impact": "Removes `gdm3`, `xserver-common` and every package that depends on them: X servers, and the\ngraphical desktop if one is installed (the `ubuntu-desktop` metapackages go with it). X client applications forwarded over SSH (`ssh -X`) still work,\nsince they use the X server of the administrator's workstation.\n",
    "notes": "The control is only in the hardened server profile; desktops need an X server or Xwayland.\n",
    "audit": {
      "manual": "Run `dpkg-query -W -f='${Status}\\n' gdm3 xserver-common`. It must not print\n`install ok installed`.\n",
      "checks": [
        {
          "id": "gdm3",
          "engine": "package",
          "description": "GNOME display manager.",
          "spec": {
            "name": "gdm3",
            "state": "absent"
          }
        },
        {
          "id": "xserver-common",
          "engine": "package",
          "description": "X.Org server common files.",
          "spec": {
            "name": "xserver-common",
            "state": "absent"
          }
        }
      ]
    },
    "remediation": {
      "manual": "Run `apt purge gdm3 xserver-common` after checking the list of packages apt will remove.\n",
      "effects": {
        "restart": "none",
        "disruption": "low",
        "lockout_risk": false
      },
      "rollback": "Reinstall the needed X server, for example `apt install xserver-xorg-core`.\n",
      "scripts": [
        {
          "id": "gdm3",
          "from_check": "gdm3"
        },
        {
          "id": "xserver-common",
          "from_check": "xserver-common"
        }
      ]
    },
    "references": [
      {
        "title": "Xserver(1), Ubuntu manual pages",
        "url": "https://manpages.ubuntu.com/manpages/noble/man1/Xserver.1.html",
        "publisher": "Canonical",
        "kind": "vendor-doc",
        "accessed": "2026-10-19"
      },
      {
        "title": "ANSSI-BP-028 v2.0 - Recommandations de configuration d'un système GNU/Linux (R58)",
        "url": "https://messervices.cyber.gouv.fr/documents-guides/fr_np_linux_configuration-v2.0.pdf",
        "publisher": "ANSSI",
        "kind": "guide",
        "accessed": "2026-10-19"
      }
    ],
    "mappings": [
      {
        "framework": "anssi-linux",
        "framework_version": "2.0",
        "id": "R58",
        "relation": "partial",
        "note": "R58 asks to install only the packages that are strictly needed; this control covers the X server."
      },
      {
        "framework": "nist-800-53r5",
        "framework_version": "5.1.1",
        "id": "CM-7",
        "relation": "partial"
      }
    ],
    "threats": [
      {
        "framework": "mitre-attack",
        "id": "T1068"
      }
    ],
    "authors": [
      {
        "name": "Alice",
        "github": "Sn0wAlice"
      }
    ],
    "verified": [
      {
        "date": "2026-10-19",
        "by": "Sn0wAlice",
        "versions": [
          "20.04"
        ],
        "environment": "Proxmox VM, Ubuntu 20.04 cloud image, kernel 5.4.0-216-generic",
        "notes": "Stock image passes; with xvfb installed (xserver-common) the check fails, fix purges it, audit passes after reboot. gdm3 check passes on the stock image (GNOME not installed in this test)."
      },
      {
        "date": "2026-10-19",
        "by": "Sn0wAlice",
        "versions": [
          "22.04"
        ],
        "environment": "Proxmox VM, Ubuntu 22.04 cloud image, kernel 5.15.0-198-generic",
        "notes": "Stock image passes; with xvfb installed (xserver-common) the check fails, fix purges it, audit passes after reboot. gdm3 check passes on the stock image (GNOME not installed in this test)."
      },
      {
        "date": "2026-10-19",
        "by": "Sn0wAlice",
        "versions": [
          "24.04"
        ],
        "environment": "Proxmox VM, Ubuntu 24.04 cloud image, kernel 6.8.0-147-generic",
        "notes": "Stock image passes; with xvfb installed (xserver-common) the check fails, fix purges it, audit passes after reboot. gdm3 check passes on the stock image (GNOME not installed in this test)."
      },
      {
        "date": "2026-10-19",
        "by": "Sn0wAlice",
        "versions": [
          "26.04"
        ],
        "environment": "Proxmox VM, Ubuntu 26.04 cloud image, kernel 7.0.0-38-generic",
        "notes": "Stock image passes; with xvfb installed (xserver-common) the check fails, fix purges it, audit passes after reboot. gdm3 check passes on the stock image (GNOME not installed in this test)."
      }
    ],
    "introduced_in": "0.1.0",
    "created": "2026-10-19",
    "updated": "2026-10-19"
  }
}