{"record":{"id":"f51ccbd64501a3d9","repo":"dagger/dagger","slug":"git-bundle-header-line-exceeds-limit-d","errorCode":null,"errorMessage":"git bundle header line exceeds limit %d","messagePattern":"git bundle header line exceeds limit (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/git_bundle.go","lineNumber":226,"sourceCode":"\ntype countingReader struct {\n\tr io.Reader\n\tn int64\n}\n\nfunc (r *countingReader) Read(p []byte) (int, error) {\n\tn, err := r.r.Read(p)\n\tr.n += int64(n)\n\treturn n, err\n}\n\nfunc parseGitBundleHeader(input io.Reader) (*GitBundle, int64, error) {\n\tcounted := &countingReader{r: input}\n\treader := bufio.NewReaderSize(counted, maxGitBundleHeaderLine)\n\treadLine := func() (string, error) {\n\t\tline, err := reader.ReadSlice('\\n')\n\t\tif errors.Is(err, bufio.ErrBufferFull) {\n\t\t\treturn \"\", fmt.Errorf(\"git bundle header line exceeds limit %d\", maxGitBundleHeaderLine)\n\t\t}\n\t\tif err != nil {\n\t\t\tif errors.Is(err, io.EOF) {\n\t\t\t\treturn \"\", fmt.Errorf(\"git bundle header is truncated\")\n\t\t\t}\n\t\t\treturn \"\", fmt.Errorf(\"read git bundle header: %w\", err)\n\t\t}\n\t\tif counted.n-int64(reader.Buffered()) > maxGitBundleHeaderBytes {\n\t\t\treturn \"\", fmt.Errorf(\"git bundle header exceeds limit %d\", maxGitBundleHeaderBytes)\n\t\t}\n\t\treturn strings.TrimSuffix(string(line), \"\\n\"), nil\n\t}\n\n\tsignature, err := readLine()\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\tbundle := &GitBundle{ObjectFormat: \"sha1\"}","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/git_bundle.go#L208-L244","documentation":"A single line of the textual bundle header exceeded the bufio buffer size (maxGitBundleHeaderLine). ReadSlice hit ErrBufferFull, meaning the header has no newline within one line's maximum length — a malformed or adversarial bundle rather than a large pack (only the header is being read at this point).","triggerScenarios":"Thrown at core/git_bundle.go:226 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Regenerate the bundle with standard `git bundle create` — well-formed header lines are short","If importing untrusted bundles, reject the file at this boundary; the limit exists to bound parsing cost","Verify the file is actually a git bundle and not arbitrary data that happens to pass the size check"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}