Repository navigation
Description
Phase: 3 | Priority: P0
Implement the local trust and staging boundary before executing any downloaded app code.
Scope
-
Consume canonical TUF metadata, platform-shipped roots and exact version/target/digest identities.
-
Perform bounded download, archive validation and manager-owned immutable extraction.
-
Check runtime/API/engine/data compatibility and show capability/scope changes before granting them.
-
Retain local verified package history for restart/recovery; separate staging from activation.
-
Read the independent public app-catalog distribution directly, using platform-shipped roots/bootstrap snapshot, bounded refresh and a persistent last-verified catalog cache. Fetch exact approved .tar.zst bytes from controlled GitHub Releases rather than the Marketplace website.
-
Treat official identity and per-version approval as signed namespace/digest metadata. Neither registration, a developer source release nor a rating is installation authority; no Marketplace/GitHub user login, shared client secret or website download ticket is required.
Dependencies
These are implementation prerequisites; app-to-app delivery gates do not create runtime dependencies.
Acceptance criteria
- All package bytes and metadata are verified before any app entrypoint or migration can execute.
- Corruption, wrong namespace/target/profile, revoked/unapproved packages and unsupported requirements fail without modifying the active app.
- Traversal, symlink/hardlink/device entries, privileged modes, duplicate paths and archive size/count expansion attacks are rejected.
- Packages are manager-owned/read-only to app identities; only designated app data/run directories are mutable.
- Interrupted/partial downloads and extraction recover or clean up safely; published version/target collisions are rejected.
- Existing verified installations start offline; recovery uses recorded trusted digests without bypassing updater trust history.
- A fresh client lists the bundled catalog and can fetch a valid current catalog plus install a newly approved package while the Marketplace website/database/account endpoints are unavailable.
- Required metadata, descriptions/icons and install assets contain no Marketplace runtime URLs. Cache writes are atomic, persist across restart and never roll updater trust state backwards.
- Expired/invalid/revoked metadata cannot authorize a new network installation. Catalog/registry outage has explicit outcomes; previously verified installed apps and valid local recovery remain usable, without pretending uncached new downloads work offline.
Planning baseline: Beta 4.
This issue schedules future work; backlog creation does not implement or deploy it.
Use focused project checks and short integration/recovery tests. Endurance runs belong to release preparation. Normal PRs need no additional documentation files or screenshot commits unless requested.
Activity
test(apps): reject malicious, mismatched and colliding packages (#588)
RentnerKev commentedon Nov 26, 2026
The acceptance criteria are covered by merged changes and tests. Two parts were deliberately left out: the bundled catalog in criterion 7 and icons in criterion 8. Both are explained below the table.
Where the tests run: ARR is the App Runtime Reference workflow, jobs "Native app runtime reference (amd64)" and "(arm64)". Rust is the CI job "Rust". Its step "Run privileged IPC fixtures with coverage" repeats the app tests as root.
recover, and migrations run from the verified package. Tests:signed_package_stages_and_recovers_offline_with_exact_identities(Rust),privileged_signed_greeting_package(ARR), and the boot into Recovery on a missing archive inprivileged_signed_lifecycle(Rust, ARR). #588 addspackaged_manifest_must_match_the_signed_releaseandpublished_tree_without_a_receipt_must_match_its_archive.privileged_published_greeting_lifecycle, #544, ARR). An unapproved next version never reaches the download (privileged_signed_greeting_package, #524). A release that asks for a new grant is refused with 409, and the active app stays unchanged (privileged_published_greeting_distribution_gates, #569, ARR). Revoked versions do not recover (signed_package_stages_and_recovers_offline_with_exact_identities). Unsupported engine or profile requirements are refused before download (engine_capability_changes_are_preflighted_for_engine_providers,target_check_reads_installed_manifests_from_the_accepted_catalog, Rust). #588 adds three refusals: a missing target (release_without_this_target_never_reaches_the_download_boundary), a packagedapp.jsonwith another namespace, version or target (packaged_manifest_must_match_the_signed_release), and an app outside its publisher namespace (catalogs_with_colliding_identities_are_not_accepted).unsafe_archive_entries_are_refused_before_publication(Rust, as user and as root). It covers../x,/bin/app, a hard link, a symbolic link, a character device, a FIFO, a setuid file, a group-writable file, a duplicate path, a case-variant duplicate, 4,097 entries and a 64 MiB + 1 file. Each one is refused with the validator's reason, nothing is published, and a sentinel file outside the store is not touched.staging_tree_refuses_special_files_before_touching_their_targetscovers special files in a staged tree.app_identity_writes_only_its_data_directory(Rust, root) and the extendedprivileged_signed_greeting_package(ARR) run a shell as the app UID. Writes to the package tree,packages/,archives/, the checkpoint and the store root fail. Writes to the app's data directory succeed. A changed owner or mode makesrecoverfail. The root step now also runsapp_manager::ui::package::tests::, which had never run as root.signed_package_stages_and_recovers_offline_with_exact_identities(#478, Rust). A partial download leaves no archive. Leftover.download-*and.stage-*workspaces are removed, a symlinked workspace is refused, and a deleted tree is extracted again. The interrupted update download inprivileged_published_greeting_lifecycleruns in ARR. #588 covers collisions.catalogs_with_colliding_identities_are_not_acceptedrefuses a release plus a revocation of one version, two releases of one version and two packages for one target, and leaves the checkpoint byte-identical. Further tests:published_tree_without_a_receipt_must_match_its_archiveandrepublished_identity_cannot_replace_an_installed_package.recoverreads only the stored checkpoint and the recorded archive and manifest digests. A restore advances the checkpoint only when the root and role floors extend the old ones and all revocations are kept. Tests:promotion_cannot_remove_or_change_observed_revocations(Rust), the offline rollback and restart inprivileged_published_greeting_lifecycle(ARR), andprivileged_restore_published_greeting(ARR). In #588,republished_identity_cannot_replace_an_installed_packagere-signs a history with other bytes for the installed version: recovery fails and the tree stays intact.privileged_published_greeting_lifecycle(#543) starts with no checkpoint, lists the catalog asreadyand installs the app. Only the catalog and release hosts answer on that host. Gates step 3 (#569) installs withmarket.rentner.devandapi.github.comblocked and records zero Marketplace connections.app-offline-restore.ts(#573) installs from the live catalog with the root shipped in the production image. All of these run in ARR. There is no bundled catalog (see deviations).signed_package_stages_and_recovers_offline_with_exact_identitiesasserts. The gates assert zero Marketplace connections and anonymous GETs only. Checkpoint and receipt writes go through a temporary file, fsync, rename and a directory fsync. No crash test exists for these writes; atomicity rests on that write order. No rollback:persisted_roles_protect_against_rollback_expiry_and_partial_metadata,startup_refresh_allows_local_readers_and_cannot_replace_a_newer_catalog, gates steps 1, 6 and 8. In #588, refused catalogs leave the checkpoint byte-identical.persisted_roles_protect_against_rollback_expiry_and_partial_metadata. Invalid metadata:installer_respects_root_path_admission_and_retains_its_catalog_when_refresh_fails(tampered checkpoint, pin mismatch) andflipped_role_signatures_leave_the_accepted_catalog_unchanged(#588). Revoked:signed_package_stages_and_recovers_offline_with_exact_identities. Outcomes: #589 reportscatalogUnavailable,packageSourceUnavailableandnetworkUnavailableand marks uncached packages. Installed apps keep running without network (gates step 8).Deviations
Open decision
update_catalogrefuses a changed release or a dropped revocation. Installations stay bound to their recorded archive and manifest digests;republished_identity_cannot_replace_an_installed_packagepins this. Whether the reader should also refuse such revisions is still open.Closing as completed.