refactor(darwin): make keychain gcore dump opt-in via build tag (#629)

Mirror the abe_embed treatment of the Windows ABE payload (#575) for the
macOS CVE-2025-24204 securityd-dump path: retag gcoredump_darwin.go under
'darwin && keychain_gcore' and add a 'darwin && !keychain_gcore' stub for
DecryptKeychainRecords. The default go build (and library consumers) then
ship without the exploit code or its byte signatures; the capability is
opt-in via -tags keychain_gcore, exactly like -tags abe_embed.

GcoredumpRetriever already treats a DecryptKeychainRecords error as a silent
fallthrough to the next tier, so the default build falls through to the
native security-CLI path with no behavior change.
This commit is contained in:
David Rogers
2026-08-07 10:25:04 +08:00
committed by GitHub
parent 4cbf7f800d
commit 500c95c86c
2 changed files with 18 additions and 1 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build darwin
//go:build darwin && keychain_gcore
package masterkey
+17
View File
@@ -0,0 +1,17 @@
//go:build darwin && !keychain_gcore
package masterkey
import (
"errors"
"github.com/moond4rk/keychainbreaker"
)
// DecryptKeychainRecords returns an error in default builds so GcoredumpRetriever
// falls through silently to the next tier. The CVE-2025-24204 securityd-dump
// implementation (gcoredump_darwin.go) is only compiled with -tags keychain_gcore,
// keeping the default `go build` free of the exploit code and its byte signatures.
func DecryptKeychainRecords() ([]keychainbreaker.GenericPassword, error) {
return nil, errors.New("keychain gcore dump not built in (rebuild with -tags keychain_gcore)")
}