Skip to content

socks: reject zero-length GSSAPI/SSPI tokens from proxy#21159

Closed
gregkh wants to merge 1 commit intocurl:masterfrom
gregkh:socks-malloc-zero
Closed

socks: reject zero-length GSSAPI/SSPI tokens from proxy#21159
gregkh wants to merge 1 commit intocurl:masterfrom
gregkh:socks-malloc-zero

Conversation

@gregkh
Copy link
Copy Markdown
Contributor

@gregkh gregkh commented Mar 30, 2026

A "broken" SOCKS5 proxy can send an invalid length of the encryption token, which could cause malloc(0) to be called, which is a "platform can do what it wants" potential problem.

Resolve this by explicitly checking the length and rejecting the invalid token before ever attempting to allocate any memory.

A "broken" SOCKS5 proxy can send an invalid length of the encryption
token, which could cause malloc(0) to be called, which is a "platform
can do what it wants" potential problem.

Resolve this by explicitly checking the length and rejecting the invalid
token before ever attempting to allocate any memory.
@bagder
Copy link
Copy Markdown
Member

bagder commented Mar 30, 2026

augment review

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 30, 2026

🤖 Augment PR Summary

Summary: Adds explicit validation to reject zero-length GSSAPI/SSPI tokens from SOCKS5 proxies.
Why: Avoids potential platform-dependent behavior from calling malloc(0) by failing the negotiation before allocating token buffers.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@bagder bagder closed this in fb6925c Mar 30, 2026
@bagder
Copy link
Copy Markdown
Member

bagder commented Mar 30, 2026

Thanks!

@gregkh gregkh deleted the socks-malloc-zero branch March 30, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants