Skip to content

fix: panics on malformed negotiation responses - #2

Merged
Mzack9999 merged 1 commit into
mainfrom
dwisiswant0/fix/panics-on-malformed-negotiation-responses
Sep 24, 2026
Merged

Mzack9999 merged 1 commit into
mainfrom
dwisiswant0/fix/panics-on-malformed-negotiation-responses

Conversation

@dwisiswant0

@dwisiswant0 dwisiswant0 commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Short negotiation replies can reach PacketCodec.Data() without a
complete SMB2 header and panic. The receiver also reads NextCommand
and splits compound packets without validating the header or offsets.

Validate headers in the receiver and accept(). Reject compound offsets
that overlap the current header or leave an incomplete next header,
returning InvalidResponseError before accessing packet fields or data.

Short negotiation replies can reach PacketCodec.Data() without a
complete SMB2 header and panic. The receiver also reads NextCommand
and splits compound packets without validating the header or offsets.

Validate headers in the receiver and accept(). Reject compound offsets
that overlap the current header or leave an incomplete next header,
returning InvalidResponseError before accessing packet fields or data.

Signed-off-by: Dwi Siswanto <git@dw1.io>
@dwisiswant0
dwisiswant0 requested review from Mzack9999 and a lite review from Copilot September 24, 2026 12:50
@dwisiswant0 dwisiswant0 self-assigned this Sep 24, 2026
@dwisiswant0
dwisiswant0 removed the request for review from Copilot September 24, 2026 12:52
@Mzack9999
Mzack9999 merged commit be4c818 into main Sep 24, 2026
1 check passed
@dwisiswant0 dwisiswant0 added the bug Something isn't working label Sep 25, 2026
@dwisiswant0
dwisiswant0 deleted the dwisiswant0/fix/panics-on-malformed-negotiation-responses branch September 25, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants