Skip to content

Conversation

wtgodbe
Copy link
Member

@wtgodbe wtgodbe commented Oct 14, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 20:19
@wtgodbe
Copy link
Member Author

wtgodbe commented Oct 14, 2025

/backport to release/10.0

@github-actions github-actions bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Oct 14, 2025
Copy link
Contributor

Started backporting to release/10.0: https://github.com/dotnet/aspnetcore/actions/runs/18509024636

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes chunked request parsing by improving validation of chunk extensions to properly reject malformed requests containing unpaired carriage return (\r) or line feed (\n) characters. The fix ensures HTTP/1.1 chunked transfer encoding follows RFC compliance while maintaining backward compatibility through a configurable switch.

Key changes:

  • Enhanced chunk extension parsing to detect and reject invalid newline sequences
  • Added comprehensive test coverage for both valid and invalid chunk extension scenarios
  • Introduced a configurable switch for backward compatibility with existing behavior

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ChunkedRequestTests.cs Adds comprehensive test cases for valid/invalid chunk extensions and edge cases with partial reads
MessageBodyTests.cs Updates existing test to use proper CRLF sequence instead of malformed input
KestrelBadHttpRequestException.cs Adds new exception case for bad chunk extensions
RequestRejectionReason.cs Defines new rejection reason for invalid chunk extensions
Http1ChunkedEncodingMessageBody.cs Implements improved chunk extension parsing with RFC compliance and backward compatibility
CoreStrings.resx Adds error message for bad chunk extension validation

@wtgodbe
Copy link
Member Author

wtgodbe commented Oct 15, 2025

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@wtgodbe wtgodbe merged commit b50ab86 into main Oct 15, 2025
31 checks passed
@wtgodbe wtgodbe deleted the wtgodbe/ChunkParsing branch October 15, 2025 20:37
@dotnet-policy-service dotnet-policy-service bot added this to the 11.0-preview1 milestone Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants