Skip to content

fix(socks5): select only offered authentication methods - #450

Open
fhgffy wants to merge 1 commit into
nadoo:mainfrom
fhgffy:fix/socks5-method-negotiation
Open

fhgffy wants to merge 1 commit into
nadoo:mainfrom
fhgffy:fix/socks5-method-negotiation

Conversation

@fhgffy

@fhgffy fhgffy commented Oct 13, 2026

Copy link
Copy Markdown

Select a SOCKS5 authentication method only when the client offered it. The server currently chooses its configured method even when the greeting does not contain that method, leaving incompatible clients to continue with an invalid negotiation.

Reply with 0xff and stop the handshake when no offered method is acceptable. Regression cases cover empty greetings, unknown methods, password-only and no-auth-only clients, and successful selection from multiple offers.

Validation (Go 1.27.2, Windows/amd64): go test -p 1 ./... -count=1, go vet -p 1 ./..., and go build -p 1 ./....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant