Repository navigation
Conversation
The update tarball is checked only against the feed's SHA-256 before /usr/bin/tar unpacks it, and the app's signature only afterwards. bsdtar refuses most dangerous members itself, but that leaves the "nothing outside the staging folder" invariant to tar's defaults, across versions and flags. List the archive with the tar crate first and refuse names outside Kiri.app, absolute or .. names (AppleDouble files aside), special files, and links whose target leaves the bundle. /usr/bin/tar still unpacks, so the sparse disk template stays sparse. Tests: a good archive, escaping names, escaping links (symlink and hard link), and special files or a missing app.
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.
The update tarball is checked against the feed's SHA-256 and unpacked with
/usr/bin/tarbeforecheck()verifies the app. bsdtar refuses..names,extraction through symlinks, an escaping hard link, and strips a leading
/,so nothing landed outside the staging folder in practice (thanks for checking
that on 27.0/27.2.1). This makes the invariant explicit instead of leaving it
to tar's defaults, across versions and flags.
check_archivelists the tarball with thetarcrate before extraction andrefuses entries outside
Kiri.app/, absolute or..names, names besidethe app (AppleDouble
._*aside), special files, and links whose targetleaves the bundle.
/usr/bin/tarstill does the unpacking, so the sparse disk template stayssparse;
taris added as a macOS-only dependency.special files, missing app.
No behaviour change for a well-formed release archive.
Originally reported as an advisory and closed as not reproducible; splitting
the hardening out as suggested.