Repository navigation
test(apps): reject malicious, mismatched and colliding packages - #588
Merged
Merged
Conversation
Prove the #452 package boundary through the real installer paths: - Refuse releases without this target before any download, and packaged manifests whose namespace, version or target differ from the signed release. - Refuse traversal, absolute paths, links, devices, FIFOs, privileged and writable modes, duplicate and case-variant paths, too many entries and an oversized expanded file without publishing a package or workspace. - Refuse signed catalogs with colliding identities or targets and flipped role signatures while the accepted checkpoint stays unchanged. - Keep a receipt-less colliding tree and a republished identity from replacing a verified installation. - Check as the app UID that only the data directory is writable, and that owner or mode drift in a staged package blocks recovery, in a root unit test and in the Greeting package test. Run the root-gated UI package tests in the privileged coverage container. Refs #452 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 44 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
These tests close the package-verification gaps that an acceptance audit of #452 found. Each test drives the real
Installerstaging, recovery and refresh paths. The fixture packages and TUF revisions are signed with the existing test keys.No production code changes. The current code already refused every malicious, mismatched and colliding case below. The tests now prove that in Platform CI.
Tests and the #452 criteria they prove
The new unit tests are in
core/tests/private/app_install/package_rejection.rs(moduleapp_install::tests::package_rejection). The Rust job runs them as a regular user. It runs them again as root in the isolated container, through the existingapp_install::tests::filter inrust-coverage.sh.release_without_this_target_never_reaches_the_download_boundarylinux-arm64is not listed onlinux-amd64. Staging it fails before any download, and the archive and package stores stay empty.packaged_manifest_must_match_the_signed_releaseapp.jsonuses another namespace (other.probe), version or target. Nopackages/<sha>, receipt or.stage-*workspace remains.unsafe_archive_entries_are_refused_before_publication../x,/bin/app, a hard link, a symbolic link to a sentinel outside the store, a character device, a FIFO, a setuid executable, a group-writable file, a duplicate path, a case-variant duplicate path, 4,097 entries, and a 64 MiB + 1 file that arrives as a small compressed transfer are each refused with the validator's specific reason. Each case leaves the package store listing unchanged, with nopackages/<sha>, receipt or workspace. The sentinel stays untouched. A valid control package from the same ustar builder is staged first.catalogs_with_colliding_identities_are_not_acceptedflipped_role_signatures_leave_the_accepted_catalog_unchangedpublished_tree_without_a_receipt_must_match_its_archiverepublished_identity_cannot_replace_an_installed_packageapp_identity_writes_only_its_data_directory(root only)app_install::tests::greeting::privileged_signed_greeting_package(extended)The boundary check (
check_app_identity_boundaries) runs/bin/shas the app UID:bin/app.Permission denied: appending tobin/app; creating, renaming or removing files in the package tree; writing topackages/,archives/, the catalog checkpoint or the store root.recoverfails whenbin/appis owned by the app UID, and whenapi(0775),api/openapi.json(0664) orbin/app(setuid) drift from their recorded mode. After the recorded owner and modes are restored, it succeeds again.CI change
rust-coverage.shnow also runsapp_manager::ui::package::tests::in the root container. The five root-gated UI package tests, such asopen_ui_files_are_bounded_and_do_not_follow_links, used to return early in the regular run and matched no root filter, so they never ran as root. They pass as root.Finding for a follow-up decision
The catalog reader authenticates the TUF chain and rejects rollback, but it does not compare releases across revisions. Only the publisher's
update_catalogrefuses to change a published release without a revocation, or to drop a revocation.republished_identity_cannot_replace_an_installed_packagepins the protection that exists today: installations stay bound to their recorded archive and manifest digests.Whether the Platform reader should also refuse such revisions is left open. Deciding that needs a review of the app-catalog history for earlier record changes.
Verification
cargo fmt --checkandcargo clippy --locked --all-targets --all-features -- -D warningspass on Linux (Kiri, Rust 1.99.1).bun --no-env-file fmt --check .githubpasses.app_install::tests::andapp_manager::ui::package::tests::(41 tests) pass as root in a container with the CI capability set, a read-only root filesystem and the CI tmpfs mounts.Refs #452
🤖 Generated with Claude Code