Conversation
The importer checked a payload's shape and the builtin marker on the PE forwarders, but nothing about the Mach-O half: libd3dshared.dylib and the D3DMetal framework, which are the code that every process in a bottle loads once the payload is deployed. A folder assembled by hand or a download altered in transit passed as long as the layout matched. Apple signs both with its own software-signing chain, so validation now runs them through SecStaticCodeCheckValidity against an "anchor apple" requirement, the same test as codesign --verify -R="anchor apple". A failure names the file. The check runs after the completeness, variant and version checks so the common mistakes still get their specific message first. The verifier is injectable on validatePayload so the fixture payloads, which are not code objects, keep validating in tests; one test runs the real check against a fixture and expects the rejection, another against /bin/ls and a plain file.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Closes the last open finding from the 2026-08-29 security review of the GPTK importer: a structurally valid but unsigned payload was accepted and deployed into every bottle's Wine tree.
What changes
GPTKImporter.validatePayloadnow verifiesexternal/libd3dshared.dylibandexternal/D3DMetal.frameworkagainst ananchor applecode requirement viaSecStaticCodeCheckValidity. Apple signs both with its software-signing chain (checked on a real 4.0b2 payload: Authority=Software Signing / Apple Code Signing CA / Apple Root CA). The PE forwarders cannot be code-signed and keep their builtin-marker check.GPTKImportError.notAppleSigned(path), surfaced in the GPTK settings section like the other import errors, with the failing file named. New localized keygptk.error.notAppleSigned(kit-only, extraction manual, en plus en-GB)./bin/lspasses, a plain file and a missing path fail).Verification
swift test --package-path WhiskyKit: 1318 XCTest plus 254 swift-testing, 0 failures (5 new tests).swiftlint lint --strictclean.codesign --verify -R="anchor apple"confirmed on the imported payload's dylib and framework on this machine, and the plain-file rejection path.Existing stores are not re-verified; the gate is at import, which is the point where a user picks a source.