Skip to content

Conversation

@vseanreesermsft
Copy link
Contributor

No description provided.

dotnet-bot and others added 9 commits February 2, 2022 17:42
…in ASP.NET Core via FormPipeReader

# [5.0] MSRC 69432 - ASP.NET Core - Denial of service in ASP.NET Core via FormPipeReader

Fixes a bug in FormPipeReader where data without a delimiter will be buffered indefinitely, beyond configured limits.

## Description

When chunked data without a delimiter is sent to FormPipeReader, FormPipeReader will read the entire stream of data, starting from the beginning each time, without honoring configured length limits. This is because, after each read, it checks if `SequenceReader.Consumed` is greater than the configured limit, but `SequenceReader.Consumed` is 0 when no delimiter was found. Therefore the check against the length limit is never honored, and we continue to read data indefinitely, starting from the beginning of the stream each time.

Also brings in the changes from dotnet#27586

## Customer Impact

Potential Denial-Of-Service attack on services using FormPipeReader

## Regression?

- [ ] Yes
- [ x ] No

[If yes, specify the version the behavior has regressed from]

## Risk

- [ ] High
- [ x ] Medium
- [ ] Low

The fix is a one-liner, and tests confirm a significant positive improvement on perf. There could be orthogonal issues that we've missed

## Verification

- [ x ] Manual (required)
- [ x ] Automated

## Packaging changes reviewed?

- [ x ] Yes
- [ ] No
- [ ] N/A

----

## When servicing release/2.1

- [ ] Make necessary changes in eng/PatchConfig.props

FormPipeReader
@ghost ghost added this to the 5.0.x milestone Mar 8, 2022
@ghost
Copy link

ghost commented Mar 8, 2022

Hi @vseanreesermsft. If this is not a tell-mode PR, please make sure to follow the instructions laid out in the servicing process document.
Otherwise, please add tell-mode label.

@Pilchie Pilchie added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Mar 8, 2022
@wtgodbe
Copy link
Member

wtgodbe commented Mar 8, 2022

@adiaaida @rbhanda are the packages/blobs done being mirrored to public yet?

@dougbu dougbu added the tell-mode Indicates a PR which is being merged during tell-mode label Mar 9, 2022
@wtgodbe
Copy link
Member

wtgodbe commented Mar 9, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@vseanreesermsft vseanreesermsft requested a review from a team as a code owner March 9, 2022 23:26
@wtgodbe wtgodbe enabled auto-merge March 9, 2022 23:29
@wtgodbe wtgodbe merged commit 0d8cd08 into dotnet:release/5.0 Mar 10, 2022
@wtgodbe wtgodbe modified the milestones: 5.0.x, 5.0.16 Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework tell-mode Indicates a PR which is being merged during tell-mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants