Skip to content

Bundled engine: probe that it can start before using it; install the AppArmor userns profile on Ubuntu - #108

Merged
ralyodio merged 1 commit into
mainfrom
fix/engine-sandbox-apparmor
Sep 16, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/engine-sandbox-apparmor

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

First launch after v3.13.0 on bonita crashed: chrome SIGTRAP in ZygoteHostImpl::Init. That is Chromium's "No usable sandbox!" fatal. Ubuntu 23.10+ sets kernel.apparmor_restrict_unprivileged_userns=1, which blocks the user namespaces Chromium's sandbox needs unless an AppArmor profile grants them to the binary. Ubuntu ships such profiles for its own browsers (/etc/apparmor.d/chrome); a third-party engine must bring its own. The Flatpak never hit this (bwrap has its own allowance) and the container test hid it (--no-sandbox).

Fix

  • Launcher, engine_usable: before choosing the bundled engine, run a throwaway headless start (--headless=new --dump-dom about:blank, temp profile, 25 s cap) once per engine version and remember success in engine/.usable. On failure fall through to a system or Flatpak Ungoogled Chromium and say why on stderr, with the userns hint when the kernel restricts it. A missing library or a missing profile is a fallback, never a crash.
  • Installer, ensure_engine_sandbox: when the kernel restricts unprivileged userns, write /etc/apparmor.d/tronbrowser-engine (Chromium's docs/security/apparmor-userns-restrictions.md form: profile tronbrowser-engine <engine path> flags=(unconfined) { userns, }) with one sudo and load it with apparmor_parser -r -T -W. Runs from ensure_engine on install and on tron upgrade, both after a download and when the engine is already current, so an engine installed by v3.13.0 gets its profile on the next upgrade. Skipped where the kernel does not restrict. Without sudo it warns and prints the retry (… | sh -s -- ensure-engine). Clears engine/.usable so the launcher re-probes.
  • Doc updated.

Verified

  • engine_usable with fake engines: starts → usable, cache written; cache honoured while VERSION unchanged even if the binary now crashes; VERSION bump re-probes; crashing engine → not usable, no cache, message with the userns hint (this box is Ubuntu 26.04 with the restriction on); missing dir → not usable.
  • ensure_engine_sandbox: profile already present for the path → no-op; no sudo → warning + return 1; the generated profile parses with apparmor_parser -Q -T.
  • sh -n on launcher and installer.

Not run on bonita: the sudo path needs a terminal there. tron upgrade will prompt once.

🤖 Generated with Claude Code

…AppArmor userns profile on Ubuntu

First launch after v3.13.0 on bonita crashed in ZygoteHostImpl::Init (SIGTRAP): Ubuntu 23.10+ blocks unprivileged user namespaces through AppArmor, so a Chromium that is not a distro package cannot set up its sandbox and aborts with No usable sandbox. The Flatpak never hit it (bwrap has its own allowance) and the container test hid it (--no-sandbox).

Two fixes. The launcher now runs a throwaway headless start of the bundled engine once per engine version (engine_usable), remembers success in engine/.usable, and on failure falls through to a system or Flatpak Ungoogled Chromium with a note saying why; a missing library or missing profile is a fallback, never a crash. And install.sh writes /etc/apparmor.d/tronbrowser-engine, granting userns to the engine binary path, with one sudo when the kernel restricts user namespaces (Chromium docs/security/apparmor-userns-restrictions.md; the same mechanism Ubuntu uses for its own browsers), on install and on tron upgrade, skipped where the kernel does not restrict, with a plain warning and the retry command when no sudo is available.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Comment thread apps/web/public/install.sh Dismissed
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

56 finding(s)

HIGH/CRITICAL: 3 | MEDIUM: 33 | LOW: 20

Severity Rule Location
HIGH py-ssrf-outbound-request apps/desktop/launcher/tron-tor-helper:303
HIGH py-ssrf-outbound-request apps/desktop/launcher/tron-tor-helper:437
HIGH sh-remote-script-execution apps/web/public/install.sh:754
MEDIUM js-open-redirect apps/desktop/extensions/ai-sidebar/install-helper.js:156
MEDIUM js-unescaped-html-sink apps/desktop/extensions/ai-sidebar/media.js:34
MEDIUM js-unescaped-html-sink apps/desktop/extensions/ai-sidebar/media.js:57
MEDIUM js-unescaped-html-sink apps/desktop/extensions/ai-sidebar/newtab.js:237
MEDIUM js-unescaped-html-sink apps/desktop/extensions/ai-sidebar/newtab.js:266
MEDIUM js-unescaped-html-sink apps/desktop/extensions/ai-sidebar/newtab.js:336
MEDIUM js-unescaped-html-sink apps/desktop/extensions/ai-sidebar/options.js:305
MEDIUM js-unescaped-html-sink apps/desktop/extensions/ai-sidebar/sidepanel.js:78
MEDIUM js-unescaped-html-sink apps/desktop/extensions/ai-sidebar/sidepanel.js:166
MEDIUM sh-remote-script-execution apps/desktop/launcher/tronbrowser:156
MEDIUM sh-remote-script-execution apps/desktop/launcher/tronbrowser:479
MEDIUM js-unescaped-html-sink apps/extensions/public/store.js:77
MEDIUM js-unescaped-html-sink apps/extensions/public/store.js:227
MEDIUM js-unescaped-html-sink apps/extensions/public/store.js:569
MEDIUM js-unescaped-html-sink apps/web/public/app.js:29
MEDIUM js-unescaped-html-sink apps/web/public/dns.js:54
MEDIUM sh-remote-script-execution apps/web/public/install.sh:161
MEDIUM sh-remote-script-execution apps/web/public/install.sh:166
MEDIUM sh-remote-script-execution apps/web/public/install.sh:279
MEDIUM sh-remote-script-execution apps/web/public/install.sh:297
MEDIUM sh-remote-script-execution apps/web/public/install.sh:810
MEDIUM sh-remote-script-execution apps/web/public/install.sh:825
MEDIUM sh-remote-script-execution apps/web/public/install.sh:1108
MEDIUM js-unescaped-html-sink apps/web/public/settings.js:96
MEDIUM js-unescaped-html-sink apps/web/public/settings.js:168
MEDIUM js-dynamic-code-execution packages/sdk/src/mcp/tools.ts:80
MEDIUM js-dynamic-code-execution packages/sdk/src/mcp/tools.ts:92
MEDIUM js-dynamic-code-execution packages/sdk/src/mcp/tools.ts:103
MEDIUM js-dynamic-code-execution packages/sdk/src/page.ts:65
MEDIUM js-dynamic-code-execution packages/sdk/src/page.ts:70
MEDIUM sql-template-interpolation services/api/src/store/db.ts:116
MEDIUM js-dynamic-code-execution services/api/src/store/scanner.ts:44
MEDIUM sh-predictable-temp-path start.sh:25
LOW js-dynamic-code-execution apps/desktop/extensions/ai-sidebar/pit-proxy.test.js:8
LOW js-dynamic-code-execution packages/agent-runtime/src/analyze/form-script.test.ts:6
LOW js-unescaped-html-sink packages/agent-runtime/src/analyze/form-script.test.ts:26
LOW js-unescaped-html-sink packages/agent-runtime/src/analyze/form-script.test.ts:49
LOW js-dynamic-code-execution packages/browser-core/src/automation/extract-script.test.ts:6
LOW js-unescaped-html-sink packages/browser-core/src/automation/extract-script.test.ts:35
LOW js-unescaped-html-sink packages/browser-core/src/automation/extract-script.test.ts:47
LOW js-unescaped-html-sink packages/browser-core/src/automation/extract-script.test.ts:70
LOW js-unescaped-html-sink packages/browser-core/src/automation/extract-script.test.ts:89
LOW js-dynamic-code-execution packages/browser-core/src/automation/snapshot-script.test.ts:11
LOW js-unescaped-html-sink packages/browser-core/src/automation/snapshot-script.test.ts:24
LOW js-unescaped-html-sink packages/browser-core/src/automation/snapshot-script.test.ts:63
LOW js-unescaped-html-sink packages/provenance/src/scan.test.ts:47
LOW js-unescaped-html-sink packages/provenance/src/scan.test.ts:170

…and 6 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit b2518ea into main Sep 16, 2026
7 of 8 checks passed
@ralyodio
ralyodio deleted the fix/engine-sandbox-apparmor branch September 17, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants