{"record":{"id":"6dca09ca844915df","repo":"ipfs/kubo","slug":"extracted-binary-exceeds-maximum-size-of-d-bytes","errorCode":null,"errorMessage":"extracted binary exceeds maximum size of %d bytes","messagePattern":"extracted binary exceeds maximum size of (.+?) bytes","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/update.go","lineNumber":787,"sourceCode":"\tdefer gzr.Close()\n\n\ttr := tar.NewReader(gzr)\n\tlookFor := \"kubo/\" + binName\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif errors.Is(err, io.EOF) {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif hdr.Name == lookFor {\n\t\t\tresult, readErr := io.ReadAll(io.LimitReader(tr, maxBinarySize+1))\n\t\t\tif readErr != nil {\n\t\t\t\treturn nil, readErr\n\t\t\t}\n\t\t\tif int64(len(result)) > maxBinarySize {\n\t\t\t\treturn nil, fmt.Errorf(\"extracted binary exceeds maximum size of %d bytes\", maxBinarySize)\n\t\t\t}\n\t\t\treturn result, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"%s not found in tar.gz\", lookFor)\n}\n\nfunc extractFromZip(data []byte, binName string) ([]byte, error) {\n\tzr, err := zip.NewReader(bytes.NewReader(data), int64(len(data)))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlookFor := \"kubo/\" + binName\n\tfor _, f := range zr.File {\n\t\tif f.Name != lookFor {\n\t\t\tcontinue\n\t\t}","sourceCodeStart":769,"sourceCodeEnd":805,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/update.go#L769-L805","documentation":"Size guard while extracting the ipfs binary from a release archive: the entry was read through a LimitReader of maxBinarySize+1 bytes and still exceeded maxBinarySize, so the archive entry is larger than any legitimate kubo binary.","triggerScenarios":"Thrown at core/commands/update.go:787 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-download the release; a corrupted or maliciously crafted archive can trigger this","Verify the release file on dist.ipfs.tech if the error persists","Install the new binary manually from the official distribution"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}