GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Discard input after a failed Socks5PrivateAuthRequestDecoder decode by Raghuvardhan-Reddy78 · Pull Request #17945 · netty/netty

Conversation

@Raghuvardhan-Reddy78

@Raghuvardhan-Reddy78 Raghuvardhan-Reddy78 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Motivation:

Socks5PrivateAuthRequestDecoder is the server-side decoder for the client's private-method sub-negotiation, so it parses untrusted input. It uses one decoded flag for both outcomes. When the request is rejected (for example a wrong version byte), fail() sets that flag without consuming any input. ByteToMessageDecoder then raises "decode() did not read anything but decoded a message", and on the next read the decoder is in its post-success pass-through mode. The rejected bytes and everything the client sends afterwards go to the next handler as raw buffers, the same as after a successful authentication:

02 03 61 62 63    -> failed DefaultSocks5PrivateAuthRequest
47 45 54          -> ByteBuf 0203616263474554

All the other socksx decoders, including Socks5PrivateAuthResponseDecoder and Socks5PasswordAuthRequestDecoder, discard input once decoding has failed.

Modification:

Track INIT / SUCCESS / FAILURE the same way Socks5PrivateAuthResponseDecoder does. On failure, skip the remaining input and drop anything received later. Add Socks5PrivateAuthRequestDecoderTest. Its failure case errors on the current code and passes with this change.

Result:

Nothing received after a failed private authentication request reaches the next handler, and the decoder no longer throws on that path.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Raghuvardhan-Reddy78 and others added 4 commits October 20, 2026 18:10
@Raghuvardhan-Reddy78
Discard input after a failed Socks5PrivateAuthRequestDecoder decode
a2b8549
Motivation:

`Socks5PrivateAuthRequestDecoder` uses one `decoded` flag for both
outcomes. When the sub-negotiation is rejected, `fail()` sets it without
consuming any input, so `ByteToMessageDecoder` raises "decode() did not
read anything but decoded a message" and, on the next read, the decoder
is in its post-success pass-through mode. The rejected bytes and
everything the client sends afterwards are then forwarded to the next
handler as raw buffers, the same as after a successful authentication:

```
02 03 61 62 63    -> failed DefaultSocks5PrivateAuthRequest
47 45 54          -> ByteBuf 0203616263474554
```

All the other socksx decoders, including
`Socks5PrivateAuthResponseDecoder` and `Socks5PasswordAuthRequestDecoder`,
discard input once decoding failed.

Modification:

Track INIT / SUCCESS / FAILURE like `Socks5PrivateAuthResponseDecoder`.
On failure skip the remaining input, and drop anything received later.
Add `Socks5PrivateAuthRequestDecoderTest`.

Result:

Nothing received after a failed private authentication request reaches
the next handler.
@normanmaurer
Merge branch '4.2' into socks5-private-auth-request-failure
0913124
@normanmaurer
Merge branch '4.2' into socks5-private-auth-request-failure
c40aaf4
@normanmaurer
Merge branch '4.2' into socks5-private-auth-request-failure
7abefdc
@testlens-app

testlens-app Bot commented Oct 29, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

🚨 All tests passed but jobs failed 🚨

Failed Jobs without Test Failures

❌ Auto-port to 4.1 / Auto-porting to 4.1

🏷️ Commit: 7abefdc
▶️ Tests: 38310 executed
⚪️ Checks: 33/33 completed

Rerun Controls

Click the checkbox to trigger a rerun:

  • Rerun jobs

Learn more about TestLens at testlens.app/docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Raghuvardhan-Reddy78

Raghuvardhan-Reddy78 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

gentle ping

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chrisvest chrisvest added this to the 4.2.21.Final milestone Nov 10, 2026
@chrisvest
chrisvest self-requested a review November 10, 2026 01:48
chrisvest
chrisvest approved these changes Nov 10, 2026
View reviewed changes
@chrisvest chrisvest added needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. labels Nov 10, 2026
@chrisvest
chrisvest merged commit be3e8d4 into netty:4.2 Nov 10, 2026
29 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@netty-project-bot

netty-project-bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Auto-port PR for 5.0: #18320

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@netty-project-bot netty-project-bot mentioned this pull request Nov 10, 2026
Auto-port 5.0: Discard input after a failed Socks5PrivateAuthRequestDecoder decode #18320
Merged
@netty-project-bot

netty-project-bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Could not create auto-port PR.
Got conflicts when cherry-picking onto 4.1.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Nov 10, 2026
normanmaurer added a commit that referenced this pull request Nov 11, 2026
@netty-project-bot @Raghuvardhan-Reddy78 @normanmaurer
Auto-port 5.0: Discard input after a failed Socks5PrivateAuthRequestD…
7fffa13
…ecoder decode (#18320)

Auto-port of #17945 to 5.0
Cherry-picked commit: be3e8d4

---
Motivation:

`Socks5PrivateAuthRequestDecoder` is the server-side decoder for the
client's private-method sub-negotiation, so it parses untrusted input.
It uses one `decoded` flag for both outcomes. When the request is
rejected (for example a wrong version byte), `fail()` sets that flag
without consuming any input. `ByteToMessageDecoder` then raises
"decode() did not read anything but decoded a message", and on the next
read the decoder is in its post-success pass-through mode. The rejected
bytes and everything the client sends afterwards go to the next handler
as raw buffers, the same as after a successful authentication:

```
02 03 61 62 63    -> failed DefaultSocks5PrivateAuthRequest
47 45 54          -> ByteBuf 0203616263474554
```

All the other socksx decoders, including
`Socks5PrivateAuthResponseDecoder` and
`Socks5PasswordAuthRequestDecoder`, discard input once decoding has
failed.

Modification:

Track INIT / SUCCESS / FAILURE the same way
`Socks5PrivateAuthResponseDecoder` does. On failure, skip the remaining
input and drop anything received later. Add
`Socks5PrivateAuthRequestDecoderTest`. Its failure case errors on the
current code and passes with this change.

Result:

Nothing received after a failed private authentication request reaches
the next handler, and the decoder no longer throws on that path.

---------

Co-authored-by: Raghuvardhan-Reddy78 <[email protected]>
Co-authored-by: Norman Maurer <[email protected]>
@chrisvest chrisvest removed the needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. label Nov 12, 2026
@chrisvest

chrisvest commented Nov 12, 2026

Copy link
Copy Markdown
Member

private auth feature is not in 4.1

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@chrisvest chrisvest chrisvest approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.2.21.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@Raghuvardhan-Reddy78 @netty-project-bot @chrisvest @normanmaurer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.