Skip to content

fix(updater): extracting the update zip drops symlinks and file permissions; the macOS in-app update can fail codesign #1765

Closed

Description

@ZhuchkaTriplesix

Problem

`extractZipSecurely` (lib/core/updater/installers/update_install_utils.dart) writes every file entry with `File.writeAsBytes`. The macOS release zip is built with `ditto -c -k --keepParent`, so it holds the symlinks of the embedded frameworks (`Versions/Current`, `FlutterMacOS`, ...) and the permission bits. The `archive` package exposes both (`isSymbolicLink` / `symbolicLink`, `unixPermissions`), but nothing reads them.

Result of the extraction:

  • every symlink becomes a regular file holding the link target as text;
  • every executable loses its `+x` bit.

`MacosSparkleInstaller` then runs `codesign --verify --deep --strict` on that copy, which a flattened signed bundle is expected to fail ("Gatekeeper verification failed"). The permission loss is confirmed on a Mac. The generated replace script already patches one symptom with `chmod +x "$EXE"` for the main executable only; other helper binaries stay non-executable.

The codesign failure itself is inferred from the code, not observed yet.

Fix

In `extractZipSecurely`:

  • create a `Link` for entries with `isSymbolicLink` (and reject targets that resolve outside the destination);
  • apply `unixPermissions` to files (POSIX only);
  • keep the existing size, ratio and traversal checks.

Add tests: an archive with a symlink and an executable entry round-trips; a symlink pointing outside the root is rejected. Once done, the `chmod +x` in `buildMacAppReplaceScript` can stay as a belt-and-braces step.

How to verify on a Mac

Update from a signed build through the app and check that it installs; before the fix, the log shows the verification error. The replace script logs to `~/Library/Logs/Querya/querya-update.log`.

Found in the system-functions review (see #1764).

Activity

  1. added
    bugSomething isn't working
    stabilityTheme parser epic label: stability
    coreCore library logic and services
    P1High priority / Core capability
    on Oct 25, 2026
  2. added 2 commits that reference this issue on Oct 25, 2026
  3. ZhuchkaTriplesix commented on Oct 25, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Fixed on dev in #1783, #1797 (merged). Closing by hand: the PRs target dev, so GitHub would only close this when dev is merged into main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High priority / Core capabilitybugSomething isn't workingcoreCore library logic and servicesstabilityTheme parser epic label: stability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions