{"id":"GO-2026-5051","revision":"8265e773412f41fa9b38b45ba249df71","records":[{"revision":"8265e773412f41fa9b38b45ba249df71","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2026-5051","aliases":[],"title":"Out-of-bounds read and panic in ReadDir in github.com/cloudsoda/go-smb2 and github.com/hirochachacha/go-smb2","description":"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.","state":0,"publishedAt":"2026-07-27T16:16:22+00:00","modifiedAt":"2026-07-27T17:00:19.8055778+00:00","affected":[{"ecosystem":"Go","name":"github.com/cloudsoda/go-smb2","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.0.0-20260609183447-7b96c35f5f4b"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"Go","name":"github.com/hirochachacha/go-smb2","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/cloudsoda/go-smb2/commit/7b96c35f5f4babfc9d68a60baf5e85f2303d4a4b","https://github.com/golang/vulndb/issues/5051"],"sourceUrl":"https://osv.dev/vulnerability/GO-2026-5051","license":"OSV · upstream source license applies","key":"osv:GO-2026-5051","identifiers":["GO-2026-5051"]},"retained":false,"historicalAffected":[]}],"coverage":[]}