Skip to content

drop-sudo fails on Ubuntu 26.04 #188

Closed

Description

@hackaugusto
Run node dist/main.js drop-sudo --user runner --group sudo
runner is not a member of the sudo group.
/home/runner/work/xxx/dist/main.js:25697
      throw new Error(`Could not restrict access to ${socket.path}.`);
            ^

Error: Could not restrict access to /run/dbus/system_bus_socket.
    at restrictRootServiceSocket (/home/runner/work/xxx/dist/main.js:25697:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async dropSudoWithPrivileges (/home/runner/work/xxx/dist/main.js:25404:13)
    at async dropSudo (/home/runner/work/xxx/dist/main.js:25316:5)
    at async _Command.<anonymous> (/home/runner/work/xxx/dist/main.js:29731:7)

Node.js v24.21.0
/home/runner/work/xxx/dist/main.js:25832
        const error = new Error(
                      ^

Error: Command failed: sudo -n node /home/runner/work/xxx/dist/main.js drop-sudo --root-phase --user runner --group sudo --runner-credentials {"userId":1001,"primaryGroupId":1001,"supplementaryGroupIds":[4,100,113,999,1001]} (exit code 1)
    at ChildProcess.<anonymous> (/home/runner/work/xxx/dist/main.js:25832:23)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1141:16)
    at ChildProcess._handle.onexit (node:internal/child_process:306:5) {
  code: 1,
  stdout: '',
  stderr: ''
}

Node.js v24.21.0
Error: Process completed with exit code 1.

it seems the setfacl doesn't apply cleanly anymore, tested with:

Run acl_backup=$(mktemp)
  acl_backup=$(mktemp)
  getfacl --absolute-names /run/dbus/system_bus_socket > "$acl_backup"
  # Restore the original ACL so the upstream check starts with the same socket state.
  trap 'sudo setfacl --restore="$acl_backup"' EXIT
  sudo setfacl -n -m u:runner:--- /run/dbus/system_bus_socket
  getfacl /run/dbus/system_bus_socket
  if sudo -u runner test -w /run/dbus/system_bus_socket; then
    echo "::error::D-Bus socket is still writable by runner after applying the deny ACL."
    exit 1
  fi
  echo "Confirmed D-Bus socket access is denied for runner."
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
getfacl: Removing leading '/' from absolute path names
# file: run/dbus/system_bus_socket
# owner: root
# group: root
user::rw-
user:runner:---
group::rw-
mask::rw-
other::rw-

Error: D-Bus socket is still writable by runner after applying the deny ACL.
Error: Process completed with exit code 1.

Activity

  1. keenranger commented on Nov 16, 2026

    @keenranger

    Reproduced on a GitHub-hosted Ubuntu 26.04.1 runner with codex-action pinned to 13e9c17: drop-sudo fails with Could not restrict access to /run/dbus/system_bus_socket. Pinning the same workflow to ubuntu-24.04 completed successfully without bypassing the safety checks. We have not tested #192 on a hosted Ubuntu 26 runner yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions