{"record":{"id":"0fb07435d387f9ce","repo":"moonD4rk/HackBrowserData","slug":"not-found-in-credential-store","errorCode":null,"errorMessage":"not found in credential store","messagePattern":"not found in credential store","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"masterkey/retriever.go","lineNumber":13,"sourceCode":"// Package masterkey retrieves Chromium master keys (per-platform retrievers + a cross-host Dump format).\n// Firefox and Safari own their own key paths and don't route through here.\npackage masterkey\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/moond4rk/hackbrowserdata/log\"\n)\n\n// errStorageNotFound: the browser's account is absent from the credential store (keychain/keyring).\nvar errStorageNotFound = errors.New(\"not found in credential store\") //nolint:unused // only used on darwin and linux\n\n// Hints bundles inputs for Retriever; each retriever reads only the field that applies to it.\ntype Hints struct {\n\tKeychainLabel  string // macOS Keychain account / Linux D-Bus Secret Service label\n\tWindowsABEKey  string // Windows ABE browser key (e.g. \"chrome\"); \"\" → ABE not applicable\n\tLocalStatePath string // path to (temp-copied) Local State JSON; only used on Windows\n}\n\n// Retriever obtains a Chromium master key from one platform source (DPAPI, Keychain, D-Bus, …).\ntype Retriever interface {\n\tRetrieveKey(hints Hints) ([]byte, error)\n}\n\n// ChainRetriever tries retrievers in order, first success wins (macOS V10: gcoredump→password→security).\ntype ChainRetriever struct {\n\tretrievers []Retriever\n}\n","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/moonD4rk/HackBrowserData/blob/0503d04d7a8d0379d060268a74f1b149e5a0aad5/masterkey/retriever.go#L1-L31","documentation":"errStorageNotFound signals that the browser's account/label is absent from the OS credential store (macOS Keychain or Linux keyring/D-Bus Secret Service). findStorageKey wraps it with the storage name via %w so callers can match with errors.Is(err, errStorageNotFound) and the retriever chain can silently fall through to the next tier.","triggerScenarios":"Calling RetrieveKey (or findStorageKey) on darwin/linux where the Hints.KeychainLabel entry does not exist in the keychain/keyring; also asserted directly in TestFindStorageKey_NotFound.","commonSituations":"Probing a browser that has never saved passwords (no keychain entry created), wrong label casing/name in Hints, running in a container/headless host with no keyring, or a keychain that was locked/deleted.","solutions":["No action needed if the browser genuinely has no stored secret — the retriever chain falls through to the next tier.","Verify Hints.KeychainLabel matches the exact keychain/keyring entry name for the target browser.","On Linux, ensure a Secret Service provider (gnome-keyring/kwallet) is running and unlocked.","Confirm you are on the same user account that created the browser's keychain entry."],"exampleFix":"// before: guessed label\nhints := masterkey.Hints{KeychainLabel: \"Chrome Safe Storage\"}\n// after: exact per-platform label\nhints := masterkey.Hints{KeychainLabel: \"Chrome\"}","handlingStrategy":"fallback","validationCode":"// linux: confirm a Secret Service is reachable\n// mac: ensure the keychain label exists before retrieving\nif hints.KeychainLabel == \"\" {\n    return errors.New(\"KeychainLabel hint is empty\")\n}","typeGuard":null,"tryCatchPattern":"key, err := retriever.RetrieveKey(hints)\nif errors.Is(err, masterkey.ErrStorageNotFound) || (errors.Is(err, errStorageNotFound)) {\n    // browser has no stored secret: fall through to next tier\n}","preventionTips":["Use the exact keychain/keyring label for the target browser.","On Linux, verify gnome-keyring/Secret Service is running and unlocked.","Run as the same user who owns the browser credentials.","Treat absence of credentials as a normal, non-fatal outcome."],"tags":["keychain","credentials","macos","linux","not-found"],"backgroundTag":"record-not-found","analyzedSha":"0503d04d7a8d0379d060268a74f1b149e5a0aad5","analyzedAt":"2026-09-06T13:38:28.707Z","contentChangedAt":"2026-09-06T13:38:28.707Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}