GO-2026-5051

Source
https://pkg.go.dev/vuln/GO-2026-5051
Import Source
https://vuln.go.dev/ID/GO-2026-5051.json
JSON Data
https://api.osv.dev/v1/vulns/GO-2026-5051
Published
2026-07-27T16:16:22Z
Modified
2026-07-27T17:00:19.805577842Z
Summary
Out-of-bounds read and panic in ReadDir in github.com/cloudsoda/go-smb2 and github.com/hirochachacha/go-smb2
Details

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.

A 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.

Database specific
{
    "review_status": "REVIEWED",
    "url": "https://pkg.go.dev/vuln/GO-2026-5051"
}
References
Credits
    • Jose Rivas (bl4cksku11)

Affected packages

Go / github.com/cloudsoda/go-smb2

Package

Name
github.com/cloudsoda/go-smb2
View open source insights on deps.dev
Purl
pkg:golang/github.com/cloudsoda/go-smb2

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.0.0-20260609183447-7b96c35f5f4b

Ecosystem specific

{
    "imports": [
        {
            "path": "github.com/cloudsoda/go-smb2",
            "symbols": [
                "Share.ReadDir",
                "Share.ReadDirPlus"
            ]
        }
    ]
}

Database specific

source
"https://vuln.go.dev/ID/GO-2026-5051.json"

Go / github.com/hirochachacha/go-smb2

Package

Name
github.com/hirochachacha/go-smb2
View open source insights on deps.dev
Purl
pkg:golang/github.com/hirochachacha/go-smb2

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected

Ecosystem specific

{
    "imports": [
        {
            "path": "github.com/hirochachacha/go-smb2",
            "symbols": [
                "Share.ReadDir"
            ]
        }
    ]
}

Database specific

source
"https://vuln.go.dev/ID/GO-2026-5051.json"