Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions home-manager/modules/clawdbot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ lib.mkIf (!env.isCI) {
}
// lib.optionalAttrs pkgs.stdenv.isLinux {
executablePath = "${pkgs.chromium}/bin/chromium";
noSandbox = true; # SUID sandbox requires root-owned binary with mode 4755

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium

Unconditionally disabling the Chromium sandbox on all Linux systems weakens browser isolation even on hosts where the SUID sandbox could be properly configured. Consider making this configurable via a module option like clawdbot.browser.noSandbox (defaulting to false) so that:

  1. The security trade-off is explicit in host configurations
  2. Only hosts that truly need it opt into the weaker security posture
  3. Future Nix updates that fix the SUID sandbox permissions can benefit automatically

Alternatively, implement runtime detection to check if ${pkgs.chromium}/libexec/chrome-sandbox has proper permissions before disabling the sandbox, so only broken environments bypass it.

Agent: 🏛 Architecture • Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#560
File: home-manager/modules/clawdbot/default.nix#L75
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
Unconditionally disabling the Chromium sandbox on all Linux systems weakens browser isolation even on hosts where the SUID sandbox could be properly configured. Consider making this configurable via a module option like `clawdbot.browser.noSandbox` (defaulting to `false`) so that:

1. The security trade-off is explicit in host configurations
2. Only hosts that truly need it opt into the weaker security posture
3. Future Nix updates that fix the SUID sandbox permissions can benefit automatically

Alternatively, implement runtime detection to check if `${pkgs.chromium}/libexec/chrome-sandbox` has proper permissions before disabling the sandbox, so only broken environments bypass it.

Copilot AI Jan 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting noSandbox = true on Linux disables Chromium’s main security sandbox, so a malicious or compromised website loaded by this headless browser could escalate directly to arbitrary code execution with the full privileges of the clawdbot process and its user account. Instead of disabling the sandbox entirely, ensure the Chromium SUID helper is installed/configured correctly or run this browser inside an additional isolation boundary (e.g., container, separate low-privilege user/namespace) so that Chromium’s own sandbox can remain enabled.

Suggested change
noSandbox = true; # SUID sandbox requires root-owned binary with mode 4755
# Rely on Chromium's default sandboxing for security; ensure the
# SUID sandbox helper is installed/configured correctly on the host
# instead of disabling it with `noSandbox = true`.

Copilot uses AI. Check for mistakes.
};
}
Comment on lines 72 to 77

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The current structure merges executablePath and noSandbox into configOverrides at the top level, alongside browser. It's more conventional and likely correct for these browser-specific settings to be nested within the browser attribute set. This refactoring moves the Linux-specific browser attributes into the browser block, improving the configuration's clarity and correctness.

        } // lib.optionalAttrs pkgs.stdenv.isLinux {
          executablePath = "${pkgs.chromium}/bin/chromium";
          noSandbox = true; # SUID sandbox requires root-owned binary with mode 4755
        };
      }

// lib.optionalAttrs pkgs.stdenv.isLinux {
Expand Down
Loading