Skip to content

Reject whitespace in HttpListener chunk sizes - #132747

Draft
MihaZupan with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-chunk-size-parsing
Draft

Reject whitespace in HttpListener chunk sizes#132747
MihaZupan with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-chunk-size-parsing

Conversation

Copilot AI commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

main PR

Description

  • Parsing: Retain the entire chunk-size field and parse only hexadecimal characters before an optional extension.
  • Regression coverage: Add a raw chunked-request test that verifies a trailing space after the size is rejected.
5 \r\n
Hello\r\n

Customer Impact

Malformed chunked requests with whitespace in the size field are now rejected rather than accepted.

Regression

No.

Testing

Targeted and full HttpListener test coverage added/run.

Risk

Low. The managed parser now rejects invalid chunk-size syntax without changing valid hexadecimal sizes or semicolon extensions.

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

Note

This PR description was generated by GitHub Copilot.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Co-authored-by: MihaZupan <25307628+MihaZupan@users.noreply.github.com>
Co-authored-by: MihaZupan <25307628+MihaZupan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

HttpListener's chunk size parsing could be more strict

2 participants