Skip to content

fix: validate nested code with kSecCSCheckNestedCode | kSecCSStrictValidate#302

Merged
MarshallOfSound merged 1 commit into
mainfrom
sam/patch-strict-codesign
May 3, 2026
Merged

fix: validate nested code with kSecCSCheckNestedCode | kSecCSStrictValidate#302
MarshallOfSound merged 1 commit into
mainfrom
sam/patch-strict-codesign

Conversation

@MarshallOfSound
Copy link
Copy Markdown
Collaborator

@MarshallOfSound MarshallOfSound commented May 2, 2026

Upstreams fix_use_kseccschecknestedcode_kseccsstrictvalidate_in_the_sec.patch. Two new specs: ShipIt-symlink and framework-binary tamper now fail validation.

Independent of the rest of the patch-upstream stack — only touches SQRLCodeSignature.m and its spec.


Part of upstreaming electron/patches/squirrel.mac/ into this repo.

@MarshallOfSound MarshallOfSound force-pushed the sam/patch-ziparchiver-crash branch from 651dee0 to dc7b67a Compare May 2, 2026 23:15
@MarshallOfSound MarshallOfSound force-pushed the sam/patch-strict-codesign branch from c3f4d35 to dc06d59 Compare May 2, 2026 23:15
Base automatically changed from sam/patch-ziparchiver-crash to main May 3, 2026 00:00
@MarshallOfSound MarshallOfSound force-pushed the sam/patch-strict-codesign branch from dc06d59 to 111fb1c Compare May 3, 2026 00:08
@MarshallOfSound MarshallOfSound changed the base branch from main to sam/deflake-termination-listener May 3, 2026 00:09
@MarshallOfSound MarshallOfSound force-pushed the sam/patch-strict-codesign branch from 111fb1c to 85985e2 Compare May 3, 2026 00:09
Base automatically changed from sam/deflake-termination-listener to main May 3, 2026 03:20
…lidate

[upstream] electron/patches/squirrel.mac/fix_use_kseccschecknestedcode_kseccsstrictvalidate_in_the_sec.patch

Ensures Squirrel validates the contents of nested bundles (frameworks,
ShipIt) when verifying the incoming update, and rejects symlinks
pointing outside the bundle.

Adds specs for: ShipIt replaced with an external symlink; nested
framework binary tampered.
@MarshallOfSound MarshallOfSound force-pushed the sam/patch-strict-codesign branch from 85985e2 to 8842e0b Compare May 3, 2026 09:00
@MarshallOfSound MarshallOfSound enabled auto-merge (squash) May 3, 2026 09:00
@MarshallOfSound MarshallOfSound merged commit 85d91d6 into main May 3, 2026
9 checks passed
@MarshallOfSound MarshallOfSound deleted the sam/patch-strict-codesign branch May 3, 2026 09:38
MarshallOfSound added a commit that referenced this pull request May 3, 2026
Upstreams the remaining `electron/patches/squirrel.mac/` patches into
this repo so Electron can eventually drop them. Six commits, **8 files,
+537/−51**, **63 → 74 tests**.

| Commit | Upstreams | Tests added |
|---|---|---|
| `feat: SquirrelMacEnableDirectContentsWrite` |
`feat_add_new_squirrel_mac_bundle_installation_method_behind_flag` |
parent-dir-untouched e2e |
| `fix: abort install if app running; resolve target path once` |
`fix_abort_installation_attempt_at_the_final_mile_if_the_app_is` +
`fix_resolve_target_bundle_path_once_at_start_of_install` |
symlink-target rejected, abort-if-running |
| `feat: ElectronSquirrelPreventDowngrades` |
`feat_add_ability_to_prevent_version_downgrades` |
`+isVersionAllowedForUpdate:from:` units |
| `refactor: harden ShipIt launch` |
`refactor_use_posix_spawn_instead_of_nstask…` +
`fix_trigger_shipit_mach_service_after_smjobsubmit…` +
`chore_turn_off_launchapplicationaturl_deprecation…` | (existing
remote-ShipIt spec exercises new path) |
| `refactor: non-deprecated NSKeyedArchiver` |
`refactor_use_non-deprecated_nskeyedarchiver_apis` |
`SQRLInstallerOwnedBundle` round-trip |
| `fix: prune orphaned staged updates` |
`fix_clean_up_orphaned_staged_updates_before_downloading_new_update` |
unit prune + e2e bounded-count; replaces `xit` |

Fixes #124. Fixes #196. Fixes #264.

> [!NOTE]
> Two adaptations should be backported to Electron's patches:
> - `SQRLUpdater.m`: `BOOL launchPrivileged = !targetWritable` in the
original `direct-contents-write` patch shadowed the outer var — it was a
dead store
> - `SQRLInstaller.m`: `runningApplicationsWithBundleIdentifier:` throws
on `nil`; guarded it

Replaces the stacked #303 / #304 / #305 / #306 / #307 / #309. #302
(strict codesign validation) stays separate — it touches only
`SQRLCodeSignature.m`.
MarshallOfSound added a commit to electron/electron that referenced this pull request May 13, 2026
Bumps squirrel.mac from 0e5d146ba1 to 8d808803bc and removes 14 patches
that have been upstreamed into Squirrel/Squirrel.Mac (mainly via
Squirrel/Squirrel.Mac#312, plus Squirrel/Squirrel.Mac#298,
Squirrel/Squirrel.Mac#302, Squirrel/Squirrel.Mac#308). Only
build_add_gn_config.patch remains, slimmed down to GN-only changes
since Squirrel/Squirrel.Mac#298 upstreamed the ReactiveCocoa ->
ReactiveObjC import renames it was carrying.
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