Serial Port Access Enabled

Interactive serial console access is enabled on Compute Engine instances, giving an administrative route to them that firewall rules and network restrictions do not control.

SeverityMedium
CVSS 3.16.6 CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H Open in the calculator
CVSS 4.07.5 CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N Open in the calculator
CWECWE-668: Exposure of Resource to Wrong Sphere
OWASP Top 10A01:2025 Broken Access Control
MITRE ATT&CKT1133 External Remote Services
CategorySecurity Misconfiguration

Description

Compute Engine instances have virtual serial ports, and setting the serial-port-enable metadata key to TRUE, on an instance or across a project, enables interactive access to the instance's serial console. Users then connect through Google's serial console gateway, for example with gcloud compute connect-to-serial-port, which reaches the instance's console regardless of its network configuration, including instances with no external IP address and instances whose VPC firewall rules block all ingress. The console therefore provides an administrative route to the instance that bypasses the VPC firewall rules, Identity-Aware Proxy and any other network-level restrictions the organisation relies on to control administrative access.

Google's documentation warns that the interactive serial console does not support IP-based access restrictions: once it is enabled, connections can be attempted from any address by anyone holding an authorised SSH key and the instance's details, and the console then presents the operating system's own login prompt. An attacker who obtains an authorised SSH key, or the IAM permissions needed to add one, together with valid operating system credentials, can therefore reach the console from anywhere and act with the rights of the account they log in as, which is often an administrative one. The need for both a key accepted by the gateway and an operating system login limits the exposure, but those are then the only controls protecting the console.

The console remains available even when the instance's network or SSH service has failed, which is why it is enabled for troubleshooting, and it is often left enabled afterwards, sometimes together with local passwords created for console login. The finding is identified by reviewing project and instance metadata for serial-port-enable, and by checking whether the constraints/compute.disableSerialPortAccess organisation policy constraint is enforced.

Remediation

  • Disable interactive serial port access by removing the serial-port-enable metadata key, or setting it to FALSE, on every instance and at project level.
  • Enforce the constraints/compute.disableSerialPortAccess organisation policy constraint at organisation or folder level, and allow temporary exceptions at project level only while troubleshooting a specific instance, removing them afterwards.
  • Remove local passwords created for console login once troubleshooting is complete.
  • Restrict who can change instance and project metadata, since that permission can re-enable the console, and alert on metadata changes that enable it, using the Admin Activity audit logs.
  • Provide routine administrative access through OS Login and Identity-Aware Proxy TCP forwarding instead.
gcloud compute instances add-metadata "$INSTANCE" --zone="$ZONE" --metadata serial-port-enable=FALSE gcloud compute project-info add-metadata --metadata serial-port-enable=FALSE

Confirm the fix by reviewing the metadata and the organisation policy, and by attempting to connect with gcloud compute connect-to-serial-port, expecting the connection to be refused.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Google Cloud Findings

Every Google Cloud finding