{"id":"GO-2026-5051","aliases":["GO-2026-5051"],"related":[],"kind":"vulnerability","state":"published","title":"Out-of-bounds read and panic in ReadDir in github.com/cloudsoda/go-smb2 and github.com/hirochachacha/go-smb2","summary":"ReadDir and ReadDirPlus parse the QUERY_DIRECTORY SMB response by advancing through entries using the server-supplied NextEntryOffset field. The pre-fix code does not bound next against the remaining buffer before re-slicing, and the entry decoder IsInvalid check performs length arithmetic in int after narrowing from uint16.\n\nA guest or anonymous directory listing against an attacker-controlled or man-in-the-middle SMB server crashes the Go client process with a runtime panic when the response contains an entry whose NextEntryOffset is larger than the remaining buffer, or whose declared FileNameLength produces a length that does not match the actual buffer size.","summaryFormat":"markdown","summarySource":"go","descriptions":[{"lang":"en","text":"ReadDir and ReadDirPlus parse the QUERY_DIRECTORY SMB response by advancing through entries using the server-supplied NextEntryOffset field. The pre-fix code does not bound next against the remaining buffer before re-slicing, and the entry decoder IsInvalid check performs length arithmetic in int after narrowing from uint16.\n\nA guest or anonymous directory listing against an attacker-controlled or man-in-the-middle SMB server crashes the Go client process with a runtime panic when the response contains an entry whose NextEntryOffset is larger than the remaining buffer, or whose declared FileNameLength produces a length that does not match the actual buffer size.","format":"markdown","source":"go"}],"published":"2026-07-27T16:16:22.000Z","modified":"2026-07-27T17:00:19.805Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20260609183447-7b96c35f5f4b"}],"ecosystem":"Go","package":"github.com/cloudsoda/go-smb2","purl":"pkg:golang/github.com/cloudsoda/go-smb2","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/hirochachacha/go-smb2","purl":"pkg:golang/github.com/hirochachacha/go-smb2","source":"go"}],"references":[{"url":"https://github.com/cloudsoda/go-smb2/commit/7b96c35f5f4babfc9d68a60baf5e85f2303d4a4b","tags":["fix"],"sources":["go"]},{"url":"https://github.com/golang/vulndb/issues/5051","tags":["report"],"sources":["go"]}],"credits":["Jose Rivas (bl4cksku11)"],"sources":[{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5051","url":"https://pkg.go.dev/vuln/GO-2026-5051","licence":"CC-BY-4.0","modified":"2026-07-27T17:00:19.805Z"}],"updatedAt":"2026-11-25T22:56:24.636Z"}