Skip to content

SS-3 Fix PROXY TCP version validation#277

Closed
vhafdal wants to merge 1 commit into
cosullivan:masterfrom
vhafdal:ss-3-proxy-validation-upstream
Closed

SS-3 Fix PROXY TCP version validation#277
vhafdal wants to merge 1 commit into
cosullivan:masterfrom
vhafdal:ss-3-proxy-validation-upstream

Conversation

@vhafdal

@vhafdal vhafdal commented Jul 15, 2026

Copy link
Copy Markdown

Summary

Fixes PROXY v1 TCP version validation in SmtpParser so TCP4 and TCP6 parsing only accepts the exact single-digit version token expected by each branch.

Root Cause

The TCP4/TCP6 parser checks used && when rejecting invalid tokens, which allowed invalid numeric versions such as TCP5 or multi-digit variants such as TCP46 to pass the version check and continue parsing.

Changes

  • Require the TCP version token to be numeric, single-character, and equal to 4 for TCP4 parsing.
  • Require the TCP version token to be numeric, single-character, and equal to 6 for TCP6 parsing.
  • Add regression coverage for invalid PROXY TCP version inputs.

Validation

  • DOTNET_ROLL_FORWARD=Major dotnet test src/SmtpServer.Tests/SmtpServer.Tests.csproj
  • Upstream-based branch result: 120 passed, 1 skipped.

Jira

  • SS-3

@vhafdal
vhafdal marked this pull request as ready for review July 15, 2026 11:38
@vhafdal

vhafdal commented Jul 15, 2026

Copy link
Copy Markdown
Author

Superseded by consolidated PR #284.

@vhafdal vhafdal closed this Jul 15, 2026
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