{"record":{"id":"ebad62252e4986ae","repo":"JanDeDobbeleer/oh-my-posh","slug":"checksum-mismatch","errorCode":null,"errorMessage":"checksum mismatch","messagePattern":"checksum mismatch","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/cli/upgrade/verify.go","lineNumber":141,"sourceCode":"\t\tif !strings.HasSuffix(line, asset) {\n\t\t\tcontinue\n\t\t}\n\n\t\tassetChecksum = strings.Fields(line)[0]\n\t\tbreak\n\t}\n\n\tif assetChecksum == \"\" {\n\t\tlog.Debug(\"failed to find checksum for asset\")\n\t\treturn fmt.Errorf(\"failed to find checksum for asset\")\n\t}\n\n\t// calculate the checksum of the binary\n\tbinaryChecksum := fmt.Sprintf(\"%x\", sha256.Sum256(binary))\n\n\tif assetChecksum != binaryChecksum {\n\t\tlog.Debugf(\"checksum mismatch, expected: %s, got: %s\", assetChecksum, binaryChecksum)\n\t\treturn fmt.Errorf(\"checksum mismatch\")\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":123,"sourceCodeEnd":146,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/cli/upgrade/verify.go#L123-L146","documentation":"After locating the asset's expected SHA256 in the checksums file, validateChecksum computes the SHA256 of the downloaded binary and compares them. A mismatch means the downloaded binary differs from what the project signed, so the upgrade aborts to prevent installing tampered or corrupted code.","triggerScenarios":"verify → validateChecksum where sha256(binary) != the checksum listed in sha256sums — truncated or corrupted download, disk corruption, or a modified binary (MITM or malicious proxy).","commonSituations":"Flaky network interrupting the asset download; proxy/cache serving a stale or altered file; security software modifying binaries on disk.","solutions":["Re-run the upgrade — most cases are transient download corruption","Bypass or disable TLS-intercepting proxies/caches","Verify manually: download the asset and compare against the published checksums on the release page","Install via the official install script or a package manager as a fallback"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := cli.Upgrade(); err != nil {\n    if strings.Contains(err.Error(), \"checksum mismatch\") {\n        // do NOT install; retry download once, then verify manually / use official installer\n    }\n}","preventionTips":["Never bypass or disable checksum verification","Re-download rather than retrying in place after a failed download","Avoid untrusted proxies/mirrors that can alter binaries","Keep antivirus exclusions minimal so it does not modify downloaded binaries"],"tags":["security","checksum","sha256","upgrade"],"backgroundTag":"checksum-mismatch","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}