{"record":{"id":"75da40fbbc6b755b","repo":"Wei-Shaw/sub2api","slug":"the-installed-chatgpt-app-has-an-unexpected-bundle","errorCode":null,"errorMessage":"the installed ChatGPT app has an unexpected bundle identifier","messagePattern":"the installed ChatGPT app has an unexpected bundle identifier","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/internal/platform/liveattestation/attestation_darwin.go","lineNumber":166,"sourceCode":"\treturn \"\", ErrChatGPTAppMissing\n}\n\nfunc readBundleIdentifier(ctx context.Context, appPath string) (string, error) {\n\tinfoPlist := filepath.Join(appPath, \"Contents\", \"Info.plist\")\n\toutput, err := exec.CommandContext(\n\t\tctx,\n\t\t\"/usr/bin/plutil\",\n\t\t\"-extract\",\n\t\t\"CFBundleIdentifier\",\n\t\t\"raw\",\n\t\tinfoPlist,\n\t).Output()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"%w: cannot read its bundle identifier\", ErrChatGPTAppMissing)\n\t}\n\tbundleID := strings.TrimSpace(string(output))\n\tif !strings.HasPrefix(bundleID, \"com.openai.\") {\n\t\treturn \"\", errors.New(\"the installed ChatGPT app has an unexpected bundle identifier\")\n\t}\n\treturn bundleID, nil\n}\n\nfunc (p *darwinProvider) readSignals(ctx context.Context) (deviceSignals, error) {\n\tconst script = `ObjC.import(\"Foundation\"); ObjC.import(\"AppKit\");\nconst screen = $.NSScreen.mainScreen;\nconst frame = screen.frame;\nJSON.stringify({\n  locale: ObjC.unwrap($.NSLocale.currentLocale.localeIdentifier),\n  languages: ObjC.deepUnwrap($.NSLocale.preferredLanguages),\n  timezone: ObjC.unwrap($.NSTimeZone.localTimeZone.name),\n  width: Number(frame.size.width),\n  height: Number(frame.size.height),\n  scale: Number(screen.backingScaleFactor)\n})`\n\toutput, err := exec.CommandContext(ctx, \"/usr/bin/osascript\", \"-l\", \"JavaScript\", \"-e\", script).Output()\n\tif err != nil {","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/Wei-Shaw/sub2api/blob/073e92d17178a1ccdb0a27017f572f10c9c7ab62/backend/internal/platform/liveattestation/attestation_darwin.go#L148-L184","documentation":"The darwin provider reads CFBundleIdentifier from the installed ChatGPT app's Info.plist via /usr/bin/plutil and requires it to start with 'com.openai.'. A different prefix means the app bundle at the discovered path is not an official OpenAI app, so attestation is refused rather than run against untrusted code.","triggerScenarios":"appPaths points at a directory containing a renamed, repackaged, or third-party 'ChatGPT'-like app whose bundle ID differs (e.g. a fork, a stub, or a differently-signed clone). plutil succeeds, but the prefix check fails.","commonSituations":"App renamed/copied to satisfy the path probe; unofficial builds or cracked apps; leftover directories from beta channels with different bundle IDs; user pointing appPaths at a custom location holding something else.","solutions":["Install the official ChatGPT app from openai.com into /Applications and remove impostor bundles.","If appPaths was overridden, reset it to the official install location.","Re-verify with `plutil -extract CFBundleIdentifier raw /Applications/ChatGPT.app/Contents/Info.plist` — it must print com.openai.*.","After replacing the app, re-run provider Check to confirm runtime resolution passes."],"exampleFix":"# before: impostor bundle\n$ plutil -extract CFBundleIdentifier raw ~/Apps/ChatGPT.app/Contents/Info.plist\ncom.someone.chatgpt-clone\n\n# after: official app\n$ plutil -extract CFBundleIdentifier raw /Applications/ChatGPT.app/Contents/Info.plist\ncom.openai.chat","handlingStrategy":"validation","validationCode":"out, err := exec.Command(\"/usr/bin/plutil\", \"-extract\", \"CFBundleIdentifier\", \"raw\",\n    filepath.Join(appPath, \"Contents\", \"Info.plist\")).Output()\nif err == nil && !strings.HasPrefix(strings.TrimSpace(string(out)), \"com.openai.\") {\n    return fmt.Errorf(\"app at %s is not the official ChatGPT bundle\", appPath)\n}","typeGuard":null,"tryCatchPattern":"if err := provider.Check(ctx); err != nil {\n    if errors.Is(err, liveattestation.ErrChatGPTAppMissing) || strings.Contains(err.Error(), \"unexpected bundle identifier\") {\n        return setupError(\"install the official ChatGPT app in /Applications\")\n    }\n    return err\n}","preventionTips":["Install the app from the official source only","Do not override appPaths to non-official bundles","Verify the bundle ID with plutil after every app update"],"tags":["macos","attestation","bundle-id","chatgpt-app","security"],"backgroundTag":null,"analyzedSha":"073e92d17178a1ccdb0a27017f572f10c9c7ab62","analyzedAt":"2026-08-15T14:33:00.750Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}