Skip to content

Pit https: import trust into the NSS database the Flatpak engine actually reads - #105

Merged
ralyodio merged 1 commit into
mainfrom
fix/pit-trust-flatpak-nssdb
Sep 16, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/pit-trust-flatpak-nssdb

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

https://chovy.hacker/ was still an invalid certificate on bonita after v3.12.0, with the leaf-trust code in place.

Why

The launcher runs the Flathub ungoogled-chromium when it is the newest engine, and that Flatpak's manifest has --persist=.pki. Inside the sandbox ~/.pki is ~/.var/app/io.github.ungoogled_software.ungoogled_chromium/.pki, so the helper's import into the real ~/.pki/nssdb was never seen by the browser. The launcher's existing Local CA sync (sync_moshpit_trust) had the same blind spot since v3.9.12.

Fix

  • tron-tor-helper (3.4.1): each leaf is imported into every database a Chromium here could read: ~/.pki/nssdb, the database the launcher names for the engine it started (TRON_PIT_NSSDB_EXTRA, created if missing), and any existing ~/.var/app/*chromium*/.pki/nssdb. Non-Chromium Flatpak databases are left alone. /pit/status and /pit/start list the databases under trust.nssdbs.
  • launcher/tronbrowser: passes the Flatpak engine's database to the helper, and sync_moshpit_trust now writes both ~/.pki/nssdb and the Flatpak one when the engine is a Flatpak. HELPER_VERSION 3.4.1 so the running helper is replaced on next launch.
  • Doc updated.

Verified

  • Helper under a fake $HOME with a pre-created ungoogled-chromium Flatpak database and a Firefox one, primary and extra databases set to scratch paths (extra nonexistent): after https://chovy.hacker/ through the pit, the leaf is in the primary, the extra (created), and the ungoogled-chromium database; the Firefox one has nothing. Second connect is a cache hit.
  • Launcher sync_moshpit_trust extracted and run with a fake $HOME, BROWSER=flatpak: the four Moshpit certificates on this box land in both ~/.pki/nssdb and ~/.var/app/<app>/.pki/nssdb; with a native engine only ~/.pki/nssdb is created.
  • Helper compiles, launcher sh -n ok. No JS changes.

Not reproduced on bonita (no SSH from here); the Flatpak --persist=.pki is read from the Flathub manifest and matches the launcher's "run the newest engine" rule.

🤖 Generated with Claude Code

…ally reads

Still an invalid certificate on bonita after v3.12.0. The launcher runs the Flathub ungoogled-chromium when it is the newest engine, and that Flatpak is sandboxed with --persist=.pki: inside it ~/.pki is ~/.var/app/io.github.ungoogled_software.ungoogled_chromium/.pki, so the helper's import into the real ~/.pki/nssdb never reached the browser. The launcher's own Local CA sync had the same blind spot.

The helper now imports each leaf into every database a Chromium could read: ~/.pki/nssdb, the database the launcher names for the engine it started (TRON_PIT_NSSDB_EXTRA, created if missing), and any ~/.var/app/*chromium*/.pki/nssdb. The launcher passes the Flatpak engine's database to the helper and its sync writes both. /pit/status lists the databases. Helper 3.4.1.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

54 finding(s)

HIGH/CRITICAL: 2 | MEDIUM: 32 | 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:424
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:122
MEDIUM sh-remote-script-execution apps/desktop/launcher/tronbrowser:440
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:704
MEDIUM sh-remote-script-execution apps/web/public/install.sh:985
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
LOW js-unescaped-html-sink packages/provenance/src/scan.test.ts:216
LOW js-dynamic-code-execution packages/sdk/src/mcp/automate.test.ts:258

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

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit bbc59d3 into main Sep 16, 2026
8 checks passed
@ralyodio
ralyodio deleted the fix/pit-trust-flatpak-nssdb 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.

1 participant